Home > Q&A > body text
如图:busy=0 or 1,求出busy=1时los的平均,同样对busy=0时也求出los的平均
ringa_lee2017-04-18 10:34:11
First groupie, then mean:
import pandas as pd df = pd.DataFrame({'busy': [1, 0, 0], 'los': [0.8111, 1.1011, 0.912]}) df.groupby('busy').mean()