Here you can use groupby() and mean() to get the desired results.
Please try with the below sample code and check.
import pandas as pd
import matplotlib.pyplot as plt
data=pd.read_csv('D:\\Priyanka\\Downloads\\Salaries.csv')
df=pd.DataFrame(data)
print(df)
mean_year = data.groupby('Year').mean()['TotalPay']
print ( mean_year)