如图:busy=0 or 1,求出busy=1时los的平均,同样对busy=0时也求出los的平均
先groupie,后用mean:
import pandas as pd df = pd.DataFrame({'busy': [1, 0, 0], 'los': [0.8111, 1.1011, 0.912]}) df.groupby('busy').mean()
548k questions
547k answers
4 comments
86.3k users