I have dataframe like this:
county
1 N
2 N
3 C
4 N
5 S
6 N
7 N
and what I'd like to reach is:
county frequency
1 N 5
2 N 5
3 C 1
4 N 5
5 S 1
6 N 5
7 N 5
Is there any possibility to add such column directly without any intermediate df. I know that I could create another df with group and size function and merge this two dataframes. Howewer, I wonder if there is any function which enable such solution without any intermediate df but maybe with usage of 'apply' and some function or lamba?