Skip to content

Literal nan string stored in dataframe using json_normalize for null value in string metadata column #25468

Closed
@joetl

Description

@joetl

Code Sample, a copy-pastable example if possible

# Your code here
import pandas as pd
data = [{"name": "test","address": [{"add": "add1"}]},{"address": [{"add": "add2"}]}]
df = pd.io.json.json_normalize(data,"address","name",errors="ignore")
df

Problem description

In Json_normalize if the metadata column is nullable with option errors set as ignore the null values in dataframe are literal nan string and not numpy.nan

Expected Output

Expecting to see numpy.nan for null metadata string column values instead of nan string

Pandas version 0.24.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO JSONread_json, to_json, json_normalizeMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions