SHARE
TWEET

Untitled

a guest Jul 12th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Temperature - humidity + wind
  2.      
  3. data = pd.read_csv('data6.csv' )
  4. data['date'] = pd.to_datetime(data['date'] + " " + data['time'], format='%m/%d/%Y %H:%M:%S')
  5. data.set_index('date', inplace=True)
  6. data = data.values
  7.  
  8. scaler = MinMaxScaler(feature_range=(0, 1))
  9. data = scaler.fit_transform(data)
  10.  
  11. train_size = int(len(data) * 0.67)
  12. test_size = len(data) - train_size
  13. train, test = data[0:train_size,:], data[train_size:len(data),:]
  14.  
  15. X = 1
  16. n_out = 1
  17.  
  18. x,y=[],[]
  19. start =0
  20. data = train.reshape(train.shape(train.shape[0] ,1, train.shape[1]))
  21. for _ in range(len(data)):
  22.   in_end = start+X
  23.   out_end= in_end + n_out
  24.   if out_end < len(data):
  25.     x_input = data[start:in_end]
  26.     x.append(x_input)
  27.     y.append(data[in_end:out_end,0])
  28. start +=1
  29.  
  30. x = np.asanyarray(x)
  31. y = np.asanyarray(y)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top