Skip to content

API: add dtype= option to python parser #14295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Nov 26, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc updates
  • Loading branch information
chris-b1 committed Nov 23, 2016
commit a5821d3dfba3232395ee4b48267236691f202d6c
1 change: 1 addition & 0 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ using the ``converters`` argument of :func:`~pandas.read_csv` would certainly be
worth trying.

.. versionadded:: 0.20.0 support for the Python parser.

The ``dtype`` option is supported by the 'python' engine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need a blank line here (to avoid warnings)


.. note::
Expand Down
17 changes: 9 additions & 8 deletions doc/source/whatsnew/v0.20.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ New features
~~~~~~~~~~~~


``read_csv`` supports ``dtype`` keyword for python engine
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``dtype`` keyword argument in the :func:`read_csv` function for specifying the types of parsed columns
is now supported with the ``'python'`` engine. See the :ref:`io docs <io.dtypes>` for more information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue references here


.. ipython:: python

data = "a,b\n1,2\n3,4"
pd.read_csv(StringIO(data), engine='python').dtypes
pd.read_csv(StringIO(data), engine='python', dtype={'a':'float64', 'b':'object'}).dtypes

.. _whatsnew_0200.enhancements.other:

Expand All @@ -32,14 +41,6 @@ Other enhancements

- ``pd.read_excel`` now preserves sheet order when using ``sheetname=None`` (:issue:`9930`)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would make a sub-section

- The ``dtype`` keyword argument in the :func:`read_csv` function for specifying the types of parsed columns
is now supported with the ``'python'`` engine. See the :ref:`io docs <io.dtypes>` for more information.

.. ipython:: python

data = "a,b\n1,2\n3,4"
pd.read_csv(StringIO(data), engine='python').dtypes
pd.read_csv(StringIO(data), engine='python', dtype={'a':'float64', 'b':'object'}).dtypes

.. _whatsnew_0200.api_breaking:

Expand Down