I want to count the number of times each value appears in a data frame.
Here is my dataframe - df:
status
1 N
2 N
3 C
4 N
5 S
6 N
7 N
8 S
9 N
10 N
11 N
12 S
13 N
14 C
15 N
16 N
17 N
18 N
19 S
20 N
I want a dictionary of words:
ex. counts = {N: 14, C:2, S:4}
I tried df['status']['N'], but it gives keyErroras well df['status'].value_counts, but is not used.
source
share