I am kinda stuck on selecting values from one column according to a specific value form a different column. For example, the following dataframe:
name profit
Anna 10000
Alice 5000
Anna 500
Anna 4000
Jack 2000
I am trying to get the mean of Anna's profit values from the profit column.
I tried using df['name'].str.contains('Anna') to select Anna from the name column, however, I'm not sure how I can go about selecting the profit values where it's only Anna.