Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Create a new DataFrame:
- df_absch=features.loc[:,["pers_sav_disp_inc","unempl","man_cap_ut","ism_pmi"]]
- list_f=df_absch.columns.tolist()
- # Generate the 3 Months and 6 Months value changes
- for i in list_f:
- df_absch[str(i+"_6m")]=df_absch[i].diff(6)
- df_absch[str(i+"_3m")]=df_absch[i].diff(3)
- # Now the original features are dropped since we won't use them anymore:
- list_f.remove("ism_pmi")
- df_absch.drop(list_f,axis=1,inplace=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement