My dataframe has an index named "Date". Which contains a large number of dates. I want to group unique dates, and perform a qcut on a column for each unique date in the df.
The following code works fine for a small number of unique dates from the dataset. However when left to run over multiple years worth of dates. The code never completes.
Is there a better way? Thanks
df['qcut_result'] = df.groupby("Date")["Column_to_qcut"].apply(pd.qcut, 10,['1','2','3','4','5','6','7','8','9','10'])