Seaborn , in seaborn doubt in a line where we are calculating mean that is tips_data[tips_data['sex'] == 'Male']['tip'].mean()

tips_data[tips_data[‘sex’] == ‘Male’][‘tip’].mean()
hi can you explain why are we writing tips_data inside of
tips_data , i m not able to understand this line , so can you tell why it is tips_data[tips_data[…so on

Hello @coding123c,
tips_data[tips_data[‘sex’] == ‘Male’][‘tip’].mean()
It is referring to tips_data datbase in which the column of tips_data that is ‘sex’ has the value ‘Male’. and find corresponding value in tip column of it and add in mean.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.