Create dataframe from specific column
<p>I am trying to create a dataframe in Pandas from the <code>AB</code> column in my csv file. (AB is the 27th column).</p>

<p>I am using this line:</p>

<pre><code>df = pd.read_csv(filename, error_bad_lines = False, usecols = [27])
</code></pre>

<p>... which is resulting in this error:</p>

<pre><code>ValueError: Usecols do not match names.
</code></pre>

<p>I'm very new to Pandas, could someone point out what i'm doing wrong to me?</p>

<p>usecols uses the column name in your csv file rather than the column number.
in your case it should be usecols=['AB'] rather than usecols=[28] that is the reason of your error stating usecols do not match names.</p>

python pandas