Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

wilshire.py 760B

1234567891011121314151617181920212223242526272829303132
  1. import numpy as np
  2. import tensorflow as tf
  3. import pandas as pd
  4. import matplotlib.pyplot as plt
  5. def parser(path):
  6. df = pd.read_csv(path,na_values='.')
  7. print(df.shape)
  8. df = df.interpolate()
  9. #df = df.dropna()
  10. print(df.shape)
  11. #df = df.drop(labels=np.arange(1825)) ### To obtain the same graph than in the article
  12. print(df.shape)
  13. return(df)
  14. def preprocess(path):
  15. df = parser(path)
  16. print(df)
  17. df_normalized = df[:]
  18. df_normalized["WILL5000INDFC"]=df_normalized["WILL5000INDFC"]/np.max(df_normalized["WILL5000INDFC"])
  19. # df.plot()
  20. # plt.show()
  21. df_train = df_normalized[:6544]
  22. df_test = df_normalized[6545:6629]
  23. # df_train.plot()
  24. # df_test.plot()
  25. # plt.show()
  26. return(df_train,df_test)