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
lint
  • Loading branch information
chris-b1 committed Nov 23, 2016
commit 7c703fe632c0a9a98ef648509d3c84ff0bc1a292
2 changes: 1 addition & 1 deletion pandas/io/tests/parser/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@ def test_dtype_with_converter(self):
# dtype spec ignored if converted specified
with tm.assert_produces_warning(ParserWarning):
result = self.read_csv(StringIO(data), dtype={'a': 'i8'},
converters={'a': lambda x: str(x)})
converters={'a': lambda x: str(x)})
expected = DataFrame({'a': ['1.1', '1.2'], 'b': [2.2, 2.3]})
tm.assert_frame_equal(result, expected)
3 changes: 2 additions & 1 deletion pandas/parser.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ cdef class TextReader:

# Should return as the desired dtype (inferred or specified)
col_res, na_count = self._convert_tokens(
i, start, end, name, na_filter, na_hashset, na_flist, col_dtype)
i, start, end, name, na_filter, na_hashset,
na_flist, col_dtype)

if na_filter:
self._free_na_set(na_hashset)
Expand Down