Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # Create a new DataFrame:
  2. df_absch=features.loc[:,["pers_sav_disp_inc","unempl","man_cap_ut","ism_pmi"]]
  3. list_f=df_absch.columns.tolist()
  4. # Generate the 3 Months and 6 Months value changes
  5. for i in list_f:
  6. df_absch[str(i+"_6m")]=df_absch[i].diff(6)
  7. df_absch[str(i+"_3m")]=df_absch[i].diff(3)
  8. # Now the original features are dropped since we won't use them anymore:
  9. list_f.remove("ism_pmi")
  10. df_absch.drop(list_f,axis=1,inplace=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement