I have a dataframe df with a 'Date' value, a 'Time' value and a 'X' value. I would like to delete all the days with a count of observation smaller than 388.
I tried to use the following
aux = df.groupby('Date')['X'].count()
for i in aux.index:
idx = df['Date']==i
if sum(idx)<388:
df = df[~(idx)]
But it is super slow. Is there a faster way to do it?