I tried this:
for col in cols1:
reg_df[col]=df[col] = reg_df[col].sub(reg_df['Intercept'])
print(col)
Because I have 500,000 columns it is taking forever. Something like 220 hours. Is there anyway to speed up the process?
I tried this:
for col in cols1:
reg_df[col]=df[col] = reg_df[col].sub(reg_df['Intercept'])
print(col)
Because I have 500,000 columns it is taking forever. Something like 220 hours. Is there anyway to speed up the process?
Code
use broadcasting
Sameple
time:
time:
Use vectorized operations.