通过数据框熊猫访问多组

时间:2020-05-04 15:10:29

标签: pandas dataframe

我使用以下语法创建了一个按不同字段分组的数据框:

rent_df=rent_df.groupby(["Garage Included","Pool", "Elevator","Ext/Int","Rooms_binned","Lot_binned"]).agg({'Price': ['sum'],'Lot Size': ['sum'],'Lot_binned': ['count']})
rent_df["Price/Sqm"]=rent_df["Price"]/rent_df["Lot Size"]

输出为以下DataFrame

enter image description here

如何过滤以访问价格/平方米,手数计数,手数/总和等...

0 个答案:

没有答案