2.40

陈元元發表於2024-10-08

import pandas as pd
import numpy as np
d=pd.DataFrame(np.random.randint(1,6,(10,4)), columns=list("ABCD"))
d1=d[:4]
d2=d[4:]
dd=pd.concat([d1,d2])
s1=d.groupby('A').mean()
s2=d.groupby('A').apply(sum)