There are some helpful functions like groupby and pivot_table that can help display the data after applying your filter.
The main idea is using a filter:
df[df.AveragePrice >= 2] which limits your dataset to only weeks where the average price was $2 or more for any given type/location.
To go a step further, I’ve used pivot table, which might be familiar for excel users to show the average price for conventional and organic, and then grabbed only the years where both exist with amount of $2 or more for at least one week in the year.
df0=df[df.AveragePrice >= 2].pivot_table(index=['year'],columns=['type'], values=['AveragePrice'], aggfunc='mean' ).reset_index()
df0[(df0.AveragePrice.conventional) > 0 & (df0.AveragePrice.organic>0)]['year'].values