title: import from CSV into Ruby array, with 1st field as hash key, then lookup a field's value given header row
body: <p>Maybe somebody can help me.  </p>
  
  <p>Starting with a CSV file like so:</p>
  
  <pre><code>Ticker,"Price","Market Cap"
  ZUMZ,30.00,933.90
  XTEX,16.02,811.57
  AAC,9.83,80.02
  </code></pre>
  
  <p>I manage to read them into an array:</p>
  
  <pre><code>require 'csv'
  tickers = CSV.read("stocks.csv", {:headers =&gt; true, :return_headers =&gt; true, :header_converters =&gt; :symbol, :converters =&gt; :all} )
  </code></pre>
  
  <p>To verify data, this works:</p>
  
  <pre><code>puts tickers[1][:ticker]
  ZUMZ
  </code></pre>
  
  <p>However this doesn't:</p>
  
  <pre><code>puts tickers[:ticker =&gt; "XTEX"][:price]
  </code></pre>
  
  <p>How would I go about turning this array into a hash using the ticker field as unique key, such that I could easily look up any other field associatively as defined in line 1 of the input? Dealing with many more columns and rows.</p>
  
  <p>Much appreciated!</p>