Skip to content

Commit 7c2b71c

Browse files
author
Jiang Yue
committed
add whatsnew entry
1 parent e53b620 commit 7c2b71c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

doc/source/whatsnew/v0.25.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Other Enhancements
133133
- :meth:`DataFrame.describe` now formats integer percentiles without decimal point (:issue:`26660`)
134134
- Added support for reading SPSS .sav files using :func:`read_spss` (:issue:`26537`)
135135
- Added new option ``plotting.backend`` to be able to select a plotting backend different than the existing ``matplotlib`` one. Use ``pandas.set_option('plotting.backend', '<backend-module>')`` where ``<backend-module`` is a library implementing the pandas plotting API (:issue:`14130`)
136+
- :meth:`io.json.json_normalize` now accepts a `fill_value` argument to fill NaN fields in given columns (:issue:`16918`)
136137

137138
.. _whatsnew_0250.api_breaking:
138139

pandas/io/json/normalize.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ def json_normalize(data, record_path=None, meta=None,
109109
----------
110110
data : dict or list of dicts
111111
Unserialized JSON objects
112-
fill_value: dict, default None
113-
default na values for specified columns
114112
record_path : string or list of strings, default None
115113
Path in each object to list of records. If not passed, data will be
116114
assumed to be an array of records
@@ -135,6 +133,11 @@ def json_normalize(data, record_path=None, meta=None,
135133
136134
.. versionadded:: 0.20.0
137135
136+
fill_value: dict, default None
137+
default na values for specified columns
138+
139+
.. versionadded:: 0.25.0
140+
138141
Returns
139142
-------
140143
frame : DataFrame

pandas/tests/io/json/test_normalize.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def deep_nested():
3838
}
3939
]
4040

41+
4142
@pytest.fixture
4243
def deep_nested_missing():
4344
# deeply nested data with some missing values
@@ -65,6 +66,7 @@ def deep_nested_missing():
6566
}
6667
]
6768

69+
6870
@pytest.fixture
6971
def state_data():
7072
return [

0 commit comments

Comments
 (0)