@@ -136,11 +136,12 @@ usecols : array-like or callable, default ``None``
136
136
that correspond to column names provided either by the user in `names ` or
137
137
inferred from the document header row(s). For example, a valid array-like
138
138
`usecols ` parameter would be ``[0, 1, 2] `` or ``['foo', 'bar', 'baz'] ``.
139
- Element order is ignored, so ``usecols=[0, 1] `` is the same as ``[1, 0] ``. Element
140
- order is ignored, so usecols=[1,0] is the same as [0,1]. To instantiate a
141
- DataFrame with element order preserved use ``pd.read_csv(usecols=[0, 1])[[0, 1]] ``
142
- for columns in ``[1, 0] `` order or ``pd.read_csv(usecols=[0, 1])[[0, 1]] ``
143
- for ``[0, 1] `` order.
139
+ Element order is ignored, so ``usecols=[0, 1] `` is the same as ``[1, 0] ``. To
140
+ instantiate a DataFrame from ``data `` with element order preserved use
141
+ ``pd.read_csv(data, usecols=['foo', 'bar'])[['foo', 'bar']] `` for columns
142
+ in ``['foo', 'bar'] `` order or
143
+ ``pd.read_csv(data, usecols=['foo', 'bar'])[['bar', 'foo']] `` for
144
+ ``['bar', 'foo'] `` order.
144
145
145
146
If callable, the callable function will be evaluated against the column names,
146
147
returning names where the callable function evaluates to True:
0 commit comments