My Code: countries_mean = fcc_good.groupby(‘CountryLive’).mean()
countries_mean[‘money_spent_per_month’][[‘United States of America’,
‘India’, ‘United Kingdom’,
I expect the code to return mean for the the specified countries. But the code is giving an output with inf values.
United States of America inf
United Kingdom inf
Name: money_spent_per_month, dtype: float64
Using median or other aggregate functions is rendering the required output. But using other metrics apart from mean doesn’t really make sense in this scenario.
Any advise on this would be appreciated!