title: ValueError: Data cardinality is ambiguous: x sizes: 1975 y sizes: 1 Make sure all arrays contain the same number of samples
body: <p>I am running this on colab, I am trying to get it to predict stock movements. I am following a tutorial and I am not very familiar with python.</p>
  <pre><code>#Imports
  import numpy as np
  import matplotlib.pyplot as plt
  import pandas as pd
  url = 'https://raw.githubusercontent.com/mwitiderrick/stockprice/master/NSE-TATAGLOBAL.csv'
  dataset_train = pd.read_csv(url)
  training_set = dataset_train.iloc[:, 1:2].values
  dataset_train.head()
  
  #Data Normalization
  from sklearn.preprocessing import MinMaxScaler
  sc = MinMaxScaler(feature_range=(0,1))
  training_set_scaled = sc.fit_transform(training_set)
  
  #Incorporating Timesteps Into Data
  X_train = []
  y_train = []
  for i in range(60, 2035):
    X_train.append(training_set_scaled[i-60:i, 0])
  y_train.append(training_set_scaled[i, 0])
  X_train, y_train = np.array(X_train), np.array(y_train)
  X_train = np.reshape(X_train, (X_train.shape[0], X_train.shape[1], 1))
  
  #Creating the LSTM Model
  from keras.models import Sequential
  from keras.layers import LSTM
  from keras.layers import Dropout
  from keras.layers import Dense
  
  model = Sequential()
  model.add(LSTM(units=50,return_sequences=True,input_shape=(X_train.shape[1], 1)))
  model.add(Dropout(0.2))
  model.add(LSTM(units=50,return_sequences=True))
  model.add(Dropout(0.2))
  model.add(LSTM(units=50,return_sequences=True))
  model.add(Dropout(0.2))
  model.add(LSTM(units=50))
  model.add(Dropout(0.2))
  model.add(Dense(units=1))
  model.compile(optimizer='adam',loss='mean_squared_error')
  model.fit(X_train,y_train,epochs=100,batch_size=32)
  
  #Making Predictions on the Test Set
  url = 'https://raw.githubusercontent.com/mwitiderrick/stockprice/master/tatatest.csv'
  dataset_test = pd.read_csv(url)
  real_stock_price = dataset_test.iloc[:, 1:2].values
  
  dataset_total = pd.concat((dataset_train['Open'], dataset_test['Open']), axis = 0)
  inputs = dataset_total[len(dataset_total) - len(dataset_test) - 60:].values
  inputs = inputs.reshape(-1,1)
  inputs = sc.transform(inputs)
  X_test = []
  for i in range(60, 76):
    X_test.append(inputs[i-60:i, 0])
  X_test = np.array(X_test)
  X_test = np.reshape(X_test, (X_test.shape[0], X_test.shape[1], 1))
  predicted_stock_price = model.predict(X_test)
  predicted_stock_price = sc.inverse_transform(predicted_stock_price)
  
  #Plotting the Results
  plt.plot(real_stock_price, color = 'black', label = 'TATA Stock Price')
  plt.plot(predicted_stock_price, color = 'green', label = 'Predicted TATA Stock Price')
  plt.title('TATA Stock Price Prediction')
  plt.xlabel('Time')
  plt.ylabel('TATA Stock Price')
  plt.legend()
  plt.show()
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>ValueError: Data cardinality is ambiguous: <br/>
  x sizes: 1975 <br/>
  y sizes: 1 <br/>
  Make sure all arrays contain the same number of samples. <br/></p>
  </blockquote>