change the frequency to column in pandas

Solutions on MaxInterview for change the frequency to column in pandas by the best coders in the world

showing results for - "change the frequency to column in pandas"
Irene
17 Sep 2018
1print df['status'].value_counts()
2N    14
3S     4
4C     2
5Name: status, dtype: int64
6
7counts = df['status'].value_counts().to_dict()
8print counts
9{'S': 4, 'C': 2, 'N': 14}
10