title: Data Type Recognition/Guessing of CSV data in python
body: <p>My problem is in the context of processing data from large CSV files. </p>
  
  <p>I'm looking for the most efficient way to determine (that is, guess) the data type of a column based on the values found in that column. I'm potentially dealing with very messy data. Therefore, the algorithm should be error-tolerant to some extent. </p>
  
  <p>Here's an example:</p>
  
  <pre><code>arr1 = ['0.83', '-0.26', '-', '0.23', '11.23']               # ==&gt; recognize as float
  arr2 = ['1', '11', '-1345.67', '0', '22']                    # ==&gt; regognize as int
  arr3 = ['2/7/1985', 'Jul 03 1985, 00:00:00', '', '4/3/2011'] # ==&gt; recognize as date
  arr4 = ['Dog', 'Cat', '0.13', 'Mouse']                       # ==&gt; recognize as str
  </code></pre>
  
  <p>Bottom line: I'm looking for a python package or an algorithm that can detect either</p>
  
  <ul>
  <li>the schema of a CSV file, or even better</li>
  <li>the data type of an individual column
  as an array</li>
  </ul>
  
  <p><a href="https://stackoverflow.com/questions/3098337/method-for-guessing-type-of-data-represented-currently-represented-as-strings-in">Method for guessing type of data represented currently represented as strings</a> goes in a similar direction.
  I'm worried about performance, though, since I'm possibly dealing with many large spreadsheets (where the data stems from)</p>