84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
df = df.groupby(['A','B'])['c'].mean()
In this way, df is grouped, but how to turn df into a dataframe with columns A, B, and C? Thanks
走同样的路,发现不同的人生
I asked this question on stackoverflow, and some netizens gave me the answer. In fact, you only need to add one parameter. The method is as follows:
df = df.groupby(['A','B'],as_index = False)['C'].mean()
At least one reassignment is needed to extract these three columns. The grouping method seems to be like yours
I asked this question on stackoverflow, and some netizens gave me the answer. In fact, you only need to add one parameter. The method is as follows:
At least one reassignment is needed to extract these three columns. The grouping method seems to be like yours