Plot key count per unique value count in pandas
A simple solution is -
df['your_column'].count_values().plot.bar(rot=0)
If you wish to limit the number of bars if the values are too many -
df['your_column'].count_values()[:no_of_values].plot.bar(rot=0)
s = df.groupby("keys").ids.agg(lambda x:len(x.unique()))
pd.value_counts(s).plot(kind="bar")
How about just directly use value_counts()
pd.value_counts(df['ids']).plot.bar()