Skip to content

Commit 20a24d0

Browse files
committed
consolidated the duplicate definitions of NA values in parsers.pyx
1 parent 18139a3 commit 20a24d0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/_libs/parsers.pyx

+6-4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ from pandas.core.algorithms import take_1d
5050
from pandas.core.dtypes.concat import union_categoricals
5151
from pandas import Index
5252

53+
import pandas.io.parsers as parsers
54+
5355
import time
5456
import os
5557

@@ -276,10 +278,10 @@ DEFAULT_CHUNKSIZE = 256 * 1024
276278
# common NA values
277279
# no longer excluding inf representations
278280
# '1.#INF','-1.#INF', '1.#INF000000',
279-
_NA_VALUES = [b'-1.#IND', b'1.#QNAN', b'1.#IND', b'-1.#QNAN',
280-
b'#N/A N/A', b'n/a', b'NA', b'#NA', b'NULL', b'null', b'NaN',
281-
b'nan', b'']
282-
281+
def c_type_conv(st):
282+
cdef bytes py_bytes = st.encode()
283+
return py_bytes
284+
_NA_VALUES = [c_type_conv(x) for x in parsers._NA_VALUES]
283285

284286
cdef class TextReader:
285287
"""

0 commit comments

Comments
 (0)