title: How to get the values before a key and after a key
body: <p>I have dictionary below</p>
  <pre><code>{'1': {'Col1': 'Val1', 'Col2': 'Val2', 'output': 'Out1'},
   '2': {'Col1': 'Val1', 'Col2': 'Val2', 'output': 'Out1'},
   '3': {'Col1': 'Val1', 'Col2': 'Val2', 'output': 'Out1'},
   '4': {'Col1': 'Val1', 'Col2': 'Val2', 'output': 'Out1'}}
  </code></pre>
  <p>I need to get the values before the key <code>output</code></p>
  <p>since dictionary is unordered i have converted into below</p>
  <pre><code>              OrderedDict([('1',
                OrderedDict([('Col1', 'Val1'),
                             ('Col2', 'Val2'),
                             ('output', 'Out1')])),
               ('2',
                OrderedDict([('Col1', 'Val1'),
                             ('Col2', 'Val2'),
                             ('output', 'Out1')])),
               ('3',
                OrderedDict([('Col1', 'Val1'),
                             ('Col2', 'Val2'),
                             ('output', 'Out1')])),
               ('4',
                OrderedDict([('Col1', 'Val1'),
                             ('Col2', 'Val2'),
                             ('output', 'Out1')]))])
  </code></pre>
  <p>Expected out is below, need to extract the values before <code>output</code></p>
  <pre><code>{'1': ['Val1', 'Val2'],
  '2': ['Val1', 'Val2'],
  '3': ['Val1', 'Val2'],
  '4': ['Val1', 'Val2']}
  </code></pre>
  <p>Expected out is below, need to extract the values after the <code>output</code> key</p>
  <pre><code>{'1': [],
  '2': [],
  '3': [],
  '4': []}
  </code></pre>
  <p>Sample dictionary for testing</p>
  <pre><code>{'1': {'Col1': 'Val1', 'output': 'Out1', 'test': 'Out1'},
   '2': {'Col1': 'Val1', 'output': 'Out1', 'test': 'Out1'},
   '3': {'Col1': 'Val1','output': 'Out1'},
   '4': {'Col1': 'Val1', 'output': 'Out1'}}
  </code></pre>
  <p>Expected out is below, need to extract the values before <code>output</code></p>
  <pre><code>{'1': ['Val1'],
  '2': ['Val1'],
  '3': ['Val1'],
  '4': ['Val1']}
  </code></pre>
  <p>Expected out is below, need to extract the values after the <code>output</code> key</p>
  <pre><code>{'1': ['Out1'],
  '2': ['Out1'],
  '3': [],
  '4': []}
  </code></pre>