title: Pulling a value from DataFrame based on another value
body: <p>I'm playing around with the Facebook Ads API, I've pulled campaign data for one of my campaigns. If I have this dataframe:</p>
  <pre><code>[&lt;Insights&gt; {
  &quot;actions&quot;: [
      {
          &quot;action_type&quot;: &quot;custom_event_abc&quot;,
          &quot;value&quot;: 50
      },
      {
          &quot;action_type&quot;: &quot;custom_event_def&quot;,
          &quot;value&quot;: 42
      },]
  </code></pre>
  <p>How would I go about getting the value for <code>custom_event_def</code> out?</p>
  <p>In my wider results, I first used <code>(df.loc[0]['actions'][1]['value'])</code> in my code which worked, but my issue with that is that <code>custom_event_abc</code> doesn't always appear and so the position of <code>custom_event_def</code>can change; meaning my solution only works some of the time.</p>
  <p>Can <code>value</code> (42) be pulled out using a reference to the <code>action_type</code>?</p>