I am a beginner at python, so bear with me!
My dataset is from excel and I was curious how to find and add a frequency column for my ID.
I first performed the groupby function for ID and date by doing:
dfcount = dfxyz.groupby(["ID", "Date"])
and then found the mean by doing:
dfcount1 = dfcount.mean()
The output i got was:
What I am trying to do is get the frequency number beside it like this:
I did not know how to copy python code, so I uploaded pictures! Sorry! Any help is appreciated for what code I can use to count the frequency for each ID AFTER I find the mean of the groupby columns.
Thank you in advance!