title: Pandas Column Consists of Arrays, Plot This Using plt.imshow()
body: <p>So I have data that is structured in a slightly unusual way. Here's an example of what I'm working with:</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  dict = {'data': [[1,2,3], [2,3,4], [3,4,5]], 'parameter': [10, 11, 12]}
  df = pd.DataFrame(dict)
  </code></pre>
  <p>In other words, each row in <code>df['data']</code> contains an array.</p>
  <p>I need to plot this using matplotlib's <code>imshow()</code> function, but I'm having difficulties working with the arrays in <code>df['data']</code>. I've tried using <code>df['data'].to_numpy()</code>, but this returns a <code>dtype=object</code>, which imshow can't handle. I get this error when trying to plot it:</p>
  <blockquote>
  <p>TypeError: Image data of dtype object cannot be converted to float</p>
  </blockquote>
  <p>To be exact, this is what I've tried to run:</p>
  <pre><code>import pylab as plt
  plt.imshow(df['data'].to_numpy())
  </code></pre>
  <p>I've read around and can't seem to find anyone with a similar example.</p>
  <p>To be clear: I need to go <em>from</em> the DataFrame <em>to</em> imshow, I cannot plot directly from the dictionary in my code. I also do not want to do any appending to new lists, as my dataset is large and will slow things down considerably.</p>
  <hr />
  <p>EDIT 1:</p>
  <p>To answer a question in the comments, this is the type of plot I'm after. The x-axis contains the arrays in <code>df['data']</code>, while the y-axis will ultimately be <code>df['parameter']</code>.
  <a href="https://i.stack.imgur.com/au1Be.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/au1Be.png" alt="enter image description here" /></a></p>
  <hr />
  <p>EDIT 2:</p>
  <p>I think I need to further clarify my question. I'm looking to reproduce this plot exactly.</p>
  <p><a href="https://i.stack.imgur.com/w6h9x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w6h9x.png" alt="enter image description here" /></a></p>
  <p>To make this plot, I did the following:</p>
  <pre><code>rows = []
  for i in df['data']: 
      rows.append(i)
  plt.imshow(rows)
  </code></pre>
  <p>This solution works with my data, but I'm looking for a more efficient way of doing the same thing. i.e., a method that doesn't involve looping and appending.</p>