title: Pandas data conversion
body: <p>I have the following data in a Pandas dataframe:</p>
  
  <pre><code>AIRPORT
  EWR|JAX
  EWR|BHX
  EWR|BHX
  EWR|BHX
  EWR|BHX
  </code></pre>
  
  <p>...
  Is there a dynamic way to convert this to:</p>
  
  <pre><code>AIRPORT  EWR JAX BHX
  EWR|JAX  Y   Y   NULL
  EWR|BHX  Y   NULL Y
  </code></pre>
  
  <p>and so on. I know how to do this if I want to count the hard coded values</p>
  
  <pre><code> df.assign(EWR = lambda x: x.TYPE.apply(lambda y: y.split('|').count('EWR')))
  </code></pre>
  
  <p>but I'm hoping not to have to write this code for each airport. </p>