I am reaching out to see if there is a way to count the number of times an account number or other key shows up in a dataframe and then place that count in the row with the account number. I know there is the value_counts() function but that is not what I am wanting to do.
This is what I am wanting to achieve. The count column is what I am wanting to append to the dataframe:
account count
0 456 3
1 123 4
2 258 2
3 456 3
4 123 4
5 123 4
6 258 2
7 456 3
8 123 4