The dataset comes from kaggle.
this code
melbourne_file_path = './melb_data.csv'
melbourne_data = pd.read_csv(melbourne_file_path)
filtered_melbourne_data = melbourne_data.dropna(axis=0)
ax = filtered_melbourne_data.boxplot(column = 'Price', by = 'Regionname');
gives this boxplot
the boxplot already has lots info, such as median, is there a way to get them corresponding to the by
s?
I tried this code adapted from this post
ax, bp = filtered_melbourne_data.boxplot(column = 'Price', by = 'Regionname', return_type='both');
and got this error
ValueError: not enough values to unpack (expected 2, got 1)
I also tried this code adapted from that post.
ax = filtered_melbourne_data.boxplot(column = 'Price', by = 'Regionname', return_type='both');
print(ax.median)
and got
<bound method Series.median of Price (AxesSubplot(0.1,0.15;0.8x0.75), {'whiskers': ...
dtype: object>
how to get the values of medians of each Regionname
?