title: How to set dtypes by column in pandas DataFrame
body: <p>I want to bring some data into a pandas DataFrame and I want to assign dtypes for each column on import.  I want to be able to do this for larger datasets with many different columns, but, as an example:</p>
  
  <pre><code>myarray = np.random.randint(0,5,size=(2,2))
  mydf = pd.DataFrame(myarray,columns=['a','b'], dtype=[float,int])
  mydf.dtypes
  </code></pre>
  
  <p>results in:</p>
  
  <blockquote>
    <p>TypeError: data type not understood</p>
  </blockquote>
  
  <p>I tried a few other methods such as:</p>
  
  <pre><code>mydf = pd.DataFrame(myarray,columns=['a','b'], dtype={'a': int})
  </code></pre>
  
  <blockquote>
    <p>TypeError: object of type 'type' has no len()</p>
  </blockquote>
  
  <p>If I put <code>dtype=(float,int)</code> it applies a float format to both columns.</p>
  
  <p>In the end I would like to just be able to pass it a list of datatypes the same way I can pass it a list of column names.</p>