title: How to flatten a list of dicts and single items into a list where single items should be duplicated
body: <p>I have this array:</p>
  <pre><code>import numpy as np
  
  array_start = [{'Very Ripe': 5}, {'Ripe': 2}, np.nan]
  </code></pre>
  <p>I want to produce an array of the individual items and duplicate the <code>np.nan</code> values so that I end up with this array:</p>
  <pre><code>&gt;&gt;&gt; array_end
  ['Very Ripe', 5, 'Ripe', 2, nan, nan]
  </code></pre>
  <p>So far I have tried the following:</p>
  <pre><code>&gt;&gt;&gt; array_end = [item.items() if isinstance(item,dict) else np.repeat(np.nan,2) for item in array_start]
  &gt;&gt;&gt; array_end
  [dict_items([('Very Ripe', 5)]), dict_items([('Ripe', 2)]), array([nan, nan])]
  </code></pre>
  <p>This has gotten me somewhere, but then it seems more difficult to unpack the <code>dict_items</code> and the latter array (of <code>np.nan</code>s) within the <code>array_end</code> to produce the target <code>array_end</code>:</p>
  <pre><code>['Very Ripe', 5, 'Ripe', 2, nan, nan]
  </code></pre>