You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this would only work if we explicity pass the column to be used as an index to usecols. However, we cannot explicitly pass an implicit index column to usecols as the index column is not named (it has no header).
The text was updated successfully, but these errors were encountered:
Are you sure you're using current master? Here's what I get for your example:
In [2]: data = 'a,b,c\n4,apple,bat,5.7\n8,orange,cow,10'
In [3]: from StringIO import StringIO
In [4]: pd.read_csv(StringIO(data))
Out[4]:
a b c
4 apple bat 5.7
8 orange cow 10.0
In [5]: pd.read_csv(StringIO(data), usecols=['a', 'b'])
Out[5]:
a b
4 apple bat
8 orange cow
In [6]: pd.__version__
Out[6]: '0.12.0-625-g3e47a3b'
Pandas 0.12
When specifying usecols with read_csv it seems impossible to use an implicit (no header) index column
Example:
Where you would prefer/expect this:
Specifying index_col = 0 would give:
So this would only work if we explicity pass the column to be used as an index to usecols. However, we cannot explicitly pass an implicit index column to usecols as the index column is not named (it has no header).
The text was updated successfully, but these errors were encountered: