Skip to content

Commit 4038cfb

Browse files
committed
ENH: Add usecols option to python parser.
Closes pandas-dev#4335 Added release note and fixed py3 compat Updated docs for consistency
1 parent f58a438 commit 4038cfb

File tree

4 files changed

+215
-146
lines changed

4 files changed

+215
-146
lines changed

doc/source/io.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ They can take a number of arguments:
8585
ways to specify the file format
8686
- ``dtype``: A data type name or a dict of column name to data type. If not
8787
specified, data types will be inferred.
88-
- ``header``: row number to use as the column names, and the start of the
88+
- ``header``: row number(s) to use as the column names, and the start of the
8989
data. Defaults to 0 if no ``names`` passed, otherwise ``None``. Explicitly
9090
pass ``header=0`` to be able to replace existing names. The header can be
9191
a list of integers that specify row locations for a multi-index on the columns
92-
E.g. [0,1,3]. Interveaning rows that are not specified will be skipped.
92+
E.g. [0,1,3]. Intervening rows that are not specified will be skipped.
9393
(E.g. 2 in this example are skipped)
9494
- ``skiprows``: A collection of numbers for rows in the file to skip. Can
9595
also be an integer to skip the first ``n`` rows
@@ -2938,7 +2938,7 @@ into BigQuery and pull it into a DataFrame.
29382938
.. code-block:: python
29392939
29402940
from pandas.io import gbq
2941-
2941+
29422942
# Insert your BigQuery Project ID Here
29432943
# Can be found in the web console, or
29442944
# using the command line tool `bq ls`
@@ -2998,7 +2998,7 @@ To add more rows to this, simply:
29982998

29992999
To use this module, you will need a BigQuery account. See
30003000
<https://cloud.google.com/products/big-query> for details.
3001-
3001+
30023002
As of 10/10/13, there is a bug in Google's API preventing result sets
30033003
from being larger than 100,000 rows. A patch is scheduled for the week of
30043004
10/14/13.

doc/source/v0.13.0.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,13 @@ Enhancements
505505
- :meth:`~pandas.io.json.json_normalize` is a new method to allow you to create a flat table
506506
from semi-structured JSON data. See :ref:`the docs<io.json_normalize>` (:issue:`1067`)
507507

508-
509508
- Added PySide support for the qtpandas DataFrameModel and DataFrameWidget.
510509

510+
- Python csv parser now supports usecols (:issue:`4335`)
511+
511512
- DataFrame has a new ``interpolate`` method, similar to Series (:issue:`4434`, :issue:`1892`)
512513

514+
513515
.. ipython:: python
514516

515517
df = DataFrame({'A': [1, 2.1, np.nan, 4.7, 5.6, 6.8],
@@ -654,7 +656,7 @@ Experimental
654656
against extremely large datasets. :ref:`See the docs <io.bigquery>`
655657

656658
.. code-block:: python
657-
659+
658660
from pandas.io import gbq
659661

660662
# A query to select the average monthly temperatures in the
@@ -665,8 +667,8 @@ Experimental
665667
query = """SELECT station_number as STATION,
666668
month as MONTH, AVG(mean_temp) as MEAN_TEMP
667669
FROM publicdata:samples.gsod
668-
WHERE YEAR = 2000
669-
GROUP BY STATION, MONTH
670+
WHERE YEAR = 2000
671+
GROUP BY STATION, MONTH
670672
ORDER BY STATION, MONTH ASC"""
671673

672674
# Fetch the result set for this query
@@ -675,7 +677,7 @@ Experimental
675677
# To find this, see your dashboard:
676678
# https://code.google.com/apis/console/b/0/?noredirect
677679
projectid = xxxxxxxxx;
678-
680+
679681
df = gbq.read_gbq(query, project_id = projectid)
680682

681683
# Use pandas to process and reshape the dataset
@@ -686,9 +688,9 @@ Experimental
686688

687689
The resulting dataframe is::
688690

689-
> df3
691+
> df3
690692
Min Tem Mean Temp Max Temp
691-
MONTH
693+
MONTH
692694
1 -53.336667 39.827892 89.770968
693695
2 -49.837500 43.685219 93.437932
694696
3 -77.926087 48.708355 96.099998

0 commit comments

Comments
 (0)