Skip to content

Commit 0a34464

Browse files
committed
Merge pull request #3544 from lexual/read_csv_doc_usecols
document read_csv's usecols argument.
2 parents e82003f + bd4c7d9 commit 0a34464

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

doc/source/io.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ They can take a number of arguments:
110110
- ``verbose``: show number of NA values inserted in non-numeric columns
111111
- ``squeeze``: if True then output with only one column is turned into Series
112112
- ``error_bad_lines``: if False then any lines causing an error will be skipped :ref:`bad lines <io.bad_lines>`
113+
- ``usecols``: a subset of columns to return, results in much faster parsing
114+
time and lower memory usage.
113115

114116
.. ipython:: python
115117
:suppress:

pandas/io/parsers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ class DateConversionError(Exception):
122122
Detect missing value markers (empty strings and the value of na_values). In
123123
data without any NAs, passing na_filter=False can improve the performance
124124
of reading a large file
125+
usecols : array-like
126+
Return a subset of the columns.
127+
Results in much faster parsing time and lower memory usage.
125128
126129
Returns
127130
-------

0 commit comments

Comments
 (0)