title: How can I have a series of numpy ndarrays as the input data to train a tensorflow machine learning model?
body: <p>I am trying to build a machine learning model which predicts a single number from a series of numbers. I am using a Sequential model from the keras API of Tensorflow.</p>
  <p>Basically my x data is a Pandas series which contains numpy ndarrays, which contain floats.
  My y data is a series of numpy ndarrays of shape (1,1), so basically just a single float value.</p>
  <p>You can imagine my dataset to look something like this:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Index</th>
  <th>x data (pandas series)</th>
  <th>y data (pandas series)</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>0</td>
  <td><code>np.ndarray(shape (1209278,) )</code></td>
  <td><code>np.ndarray(shape = () )</code></td>
  </tr>
  <tr>
  <td>1</td>
  <td><code>np.ndarray(shape (1211140,) )</code></td>
  <td><code>np.ndarray(shape = () )</code></td>
  </tr>
  <tr>
  <td>2</td>
  <td><code>np.ndarray(shape (1418411,) )</code></td>
  <td><code>np.ndarray(shape = () )</code></td>
  </tr>
  <tr>
  <td>3</td>
  <td><code>np.ndarray(shape (1077132,) )</code></td>
  <td><code>np.ndarray(shape = () )</code></td>
  </tr>
  <tr>
  <td>...</td>
  <td>...</td>
  <td>...</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The type of my x data and y data is, as stated above, a pandas series.
  When I try to train my model using the fit function it yields this error:</p>
  <p><em>ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)</em></p>
  <p>I also tried converting the pandas series to a numpy array, but this did not help.
  As it seems, the fact that I have a series of differently shaped ndarrays as my input data is the problem itself.</p>
  <p>I don't really know what I can do, to fix this error.
  Which leads me to my question:</p>
  <p><strong>How can I have a series of numpy ndarrays as the input data to train a tensorflow machine learning model?</strong></p>