-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
jorisvandenbossche
merged 24 commits into
pandas-dev:master
from
chris-b1:textreader-dtype
Nov 26, 2016
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
960441a
API: add dtype= option to python parser
chris-b1 7be7b42
remove unsupported test
chris-b1 65a94ae
add test/fix for dtype=object
chris-b1 6853587
float precision...
chris-b1 3024177
float precision fix
chris-b1 f9ff10e
add docs; test for conv cast
chris-b1 f5b23a6
Add warning if both converter and dtype specified
chris-b1 e0e5ae8
doc comments
chris-b1 a5821d3
doc updates
chris-b1 7c703fe
lint
chris-b1 d790bdf
API: add dtype= option to python parser
chris-b1 5462774
remove unsupported test
chris-b1 64c7214
add test/fix for dtype=object
chris-b1 26f42c2
float precision...
chris-b1 7fbe0a3
float precision fix
chris-b1 08315b8
add docs; test for conv cast
chris-b1 810e750
Add warning if both converter and dtype specified
chris-b1 10f5be3
doc comments
chris-b1 b2f7b94
doc updates
chris-b1 be2b43b
lint
chris-b1 47669d3
TST: move empty dtype tests from c_parser_only to dtype tests
jorisvandenbossche 34e3a96
Merge branch 'textreader-dtype' of https://github.com/chris-b1/pandas…
chris-b1 1706b39
issue ref
chris-b1 3abb0bd
fix merge conflict leftover
jorisvandenbossche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
doc updates
- Loading branch information
commit a5821d3dfba3232395ee4b48267236691f202d6c
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
||
|
@@ -32,14 +41,6 @@ Other enhancements | |
|
||
- ``pd.read_excel`` now preserves sheet order when using ``sheetname=None`` (:issue:`9930`) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)