Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
320 B
0
Indexable
Never
district_counts_low = data_low_rating.groupby(['district', 'category'])['name'].count().reset_index(name='count_low')
district_counts_low['total_count_low'] = district_counts_low.groupby('district')['count_low'].transform('sum')
district_counts_low = district_counts_low.sort_values('total_count_low', ascending=False)