10000 consolidated the duplicate definitions of NA values (in parsers & IO) by OlegShteynbuk · Pull Request #16589 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

consolidated the duplicate definitions of NA values (in parsers & IO) #16589

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 14 commits into from
Jun 13, 2017
Merged
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
added pesky blank lines - E302 expected 2 blank lines, found 1 in par…
…sers.pyx
  • Loading branch information
OlegShteynbuk committed Jun 13, 2017
commit 1f0a350dcc6df99f9d8b201f7102b08a04503ff8
7 changes: 4 additions & 3 deletions pandas/_libs/parsers.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,14 @@ cdef extern from "parser/io.h":

DEFAULT_CHUNKSIZE = 256 * 1024

# common NA values
# no longer excluding inf representations
# '1.#INF','-1.#INF', '1.#INF000000',

def c_type_conv(st):
cdef bytes py_bytes = st.encode()
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 we have a routine already like this
look around

Copy link
Contributor Author
@OlegShteynbuk OlegShteynbuk Jun 3, 2017

Choose a reason for hiding this comment

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

thanks, i think have found the function
_NA_VALUES = _ensure_encoded(parsers._NA_VALUES)
then even list comprehension is not needed; need to double check as haven't used Cython before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

another function that can be used is asbytes

return py_bytes

# common NA values
# no longer excluding inf representations
# '1.#INF','-1.#INF', '1.#INF000000',
_NA_VALUES = [c_type_conv(x) for x in parsers._NA_VALUES]


Expand Down
0