column 1 as key and count in column 2 code example Example: number of times a value occurs in dataframne df['a'].value_counts()