I have a question regarding Pandas.
I grouped data by column (Districts)
GroupByDistrict = df.groupby(['District'])
and then I want to get data
print(GroupByDistrict['Price'].agg(['median','mean']))
Output of this command shows average prices in different districts.
How can I assign this data to a variable (list or dictionary)?
If I do something like this
xx = GroupByDistrict['Price'].agg(['median','mean'])
print(xx)
the output gives object