From a5d7b348cfa19a063c957da28db5a1a8aed88ef4 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Mon, 14 Oct 2024 12:46:38 +0530 Subject: [PATCH] DOC: fix RT03,SA01,ES01 for pandas.json_normalize --- ci/code_checks.sh | 1 - pandas/io/json/_normalize.py | 13 +++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 1974c98a1d1ff..c4fcdcfcc4ffe 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -154,7 +154,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.infer_freq SA01" \ -i "pandas.io.json.build_table_schema PR07,RT03,SA01" \ -i "pandas.io.stata.StataWriter.write_file SA01" \ - -i "pandas.json_normalize RT03,SA01" \ -i "pandas.plotting.andrews_curves RT03,SA01" \ -i "pandas.plotting.scatter_matrix PR07,SA01" \ -i "pandas.set_eng_float_format RT03,SA01" \ diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py index 7d3eefae39679..45c8876dbe3e5 100644 --- a/pandas/io/json/_normalize.py +++ b/pandas/io/json/_normalize.py @@ -279,6 +279,10 @@ def json_normalize( """ Normalize semi-structured JSON data into a flat table. + This method is designed to transform semi-structured JSON data, such as nested + dictionaries or lists, into a flat table. This is particularly useful when + handling JSON-like data structures that contain deeply nested fields. + Parameters ---------- data : dict, list of dicts, or Series of dicts @@ -310,8 +314,13 @@ def json_normalize( Returns ------- - frame : DataFrame - Normalize semi-structured JSON data into a flat table. + DataFrame + The normalized data, represented as a pandas DataFrame. + + See Also + -------- + DataFrame : Two-dimensional, size-mutable, potentially heterogeneous tabular data. + Series : One-dimensional ndarray with axis labels (including time series). Examples --------