Determining Pandas Column DataType
<p>Sometimes when data is imported to Pandas Dataframe, it always imports as type <code>object</code>.  This is fine and well for doing most operations, but I am trying to create a custom export function, and my question is this:</p>

<ul>
<li>Is there a way to force Pandas to infer the data types of the input data?</li>
<li>If not, is there a way after the data is loaded to infer the data types somehow?</li>
</ul>

<p>I know I can tell Pandas that this is of type int, str, etc.. but I don't want to do that, I was hoping pandas could be smart enough to know all the data types when a user imports or adds a column.</p>

<p>EDIT - example of import</p>

<pre><code>a = ['a']
col = ['somename']
df = pd.DataFrame(a, columns=col)
print(df.dtypes)
&gt;&gt;&gt; somename    object
dtype: object
</code></pre>

<p>The type should be string? </p>