Inputs:
df['PopEst']
.astype('float')
.groupby(ContinentDict)
.agg(['size','sum','mean','std']))
Outputs:
size sum mean std
Asia 5 2.898666e+09 5.797333e+08 6.790979e+08
Australia 1 2.331602e+07 2.331602e+07 NaN
Europe 6 4.579297e+08 7.632161e+07 3.464767e+07
North America 2 3.528552e+08 1.764276e+08 1.996696e+08
South America 1 2.059153e+08 2.059153e+08 NaN
Some values in column of std turns out to be NaN if the group just have one row, but I think these values are supposed to be 0, why is that?