My Dataset has many columns. Here are two:
Index Graduated Age
0 College 24
1 HighSch 18
2 College 26
3 College Nan
4 HighSch 20
The mean of Age is simple enough:
df.Age.mean()
However, I have many other columns, therefore I'm using agg():
df.groupby('Graduated').agg({'Age':'mean'})
The error I get:
No numeric types to aggregate If I insert a number instead of NaN, it works!!
Does the agg() function not allow us to run the mean if column has NaN values? Is there a way around that?