convert pandas dataframe column from hex string to int
<p>I have a very large dataframe that I would like to avoid iterating through every single row and want to convert the entire column from hex string to int. It doesn't process the string correctly with astype but has no problems with a single entry. Is there a way to tell astype the datatype is base 16?</p>

<pre><code>IN:
import pandas as pd
df = pd.DataFrame(['1C8','0C3'], columns=['Command0'])
df['Command0'].astype(int)
OUT:
ValueError: invalid literal for int() with base10: '1C8'
</code></pre>

<p>This works but want to avoid row iteration.</p>

<pre><code>for index, row in df.iterrows():
    print(row['Command0'])
</code></pre>

<p>I'm reading this in from a CSV <code>pd.read_csv(open_csv, nrows=20)</code> so if there is a way to read it in and explicitly tell it what the format is then that would be even better!</p>