Skip to content

Commit 4c0cf67

Browse files
committed
Merge pull request #7639 from jreback/na_values
REGR: Add back #N/A N/A as a default NA value (regresion from 0.12) (GH5521)
2 parents 17b2322 + 37d2477 commit 4c0cf67

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

doc/source/v0.14.1.txt

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ API changes
5959
object isn't a ``Period`` ``False`` is returned. (:issue:`7376`)
6060

6161
- Bug in ``.loc`` performing fallback integer indexing with ``object`` dtype indices (:issue:`7496`)
62+
- Add back ``#N/A N/A`` as a default NA value in text parsing, (regresion from 0.12) (:issue:`5521`)
6263

6364
.. _whatsnew_0141.prior_deprecations:
6465

pandas/io/parsers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def read_fwf(filepath_or_buffer, colspecs='infer', widths=None, **kwds):
487487
# no longer excluding inf representations
488488
# '1.#INF','-1.#INF', '1.#INF000000',
489489
_NA_VALUES = set([
490-
'-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN', '#N/A', 'N/A', 'NA', '#NA',
490+
'-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN', '#N/A N/A', '#N/A', 'N/A', 'NA', '#NA',
491491
'NULL', 'NaN', '-NaN', 'nan', '-nan', ''
492492
])
493493

pandas/io/tests/test_parsers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def test_non_string_na_values(self):
706706
def test_default_na_values(self):
707707
_NA_VALUES = set(['-1.#IND', '1.#QNAN', '1.#IND', '-1.#QNAN',
708708
'#N/A','N/A', 'NA', '#NA', 'NULL', 'NaN',
709-
'nan', '-NaN', '-nan', ''])
709+
'nan', '-NaN', '-nan', '#N/A N/A',''])
710710
assert_array_equal (_NA_VALUES, parsers._NA_VALUES)
711711
nv = len(_NA_VALUES)
712712
def f(i, v):

0 commit comments

Comments
 (0)