Create new columns using groupby in pandas
I don't know if I fully understand the end goal, it's difficult to tell without some sample data, however there are certainly better ways to make this call.

I noticed the manipulations over each column could be simplified to a Pandas apply, so that's what I went for.

suffixed = [i + '_rank' for i in df.columns]

g = df.groupby('date')

df[suffixed] = df[df.columns].apply(lambda column: g[column.name].rank() / df['counts_date'])


There could be a way to precompute the group ranks and then concatenate those columns straight to the original, but I didn't attempt that.

Apply will almost always be faster than a for loop.