Subs_1718 Count_1718 Subs_1819 Count_1819 Subs_1920 Count_1920
Apple 10.0 Grapes 12 Banana 12.0
Grapes 2.0 Apple 6 Grapes 8.0
Banana 2.0 Pineapple 3 Cashew 1.0
Dragonfruit 1.0 Banana 2 Apple 1.0
Kiwi 1.0 Kiwi 2 Melon 1.0
Melon 1.0 Cashew 1 Grapes 1.0
How do I create a new column that value_counts the values of the columns of df['Count_1718']
,
df['Count_1819']
,df['Count_1920']
?
Expected Output:
Subs_1720 Count_1720
Apple 17
Banana 16
Cashew 2
Dragonfruit 1
Grapes 22
Melon 2
Pineapple 1