I know the question is quite old, but I got here searching for answers. There is actually a better (and faster) way now of doing this using json_normalize
:
import pandas as pd
df2 = pd.json_normalize(df['Pollutant Levels'])
This avoids costly apply functions…
Related Contents:
- How to json_normalize a column with NaNs
- flattening nested Json in pandas data frame
- Remap values in pandas column with a dict, preserve NaNs
- Convert list of dictionaries to a pandas DataFrame
- How can I convert JSON to CSV?
- JSON to pandas DataFrame
- Convert a Pandas DataFrame to a dictionary
- Replace values in a pandas series via dictionary efficiently
- Efficient way to unnest (explode) multiple list columns in a pandas DataFrame
- How to extract multiple JSON objects from one file?
- Converting dictionary to JSON
- Access a particular field in arbitrarily nested JSON data [duplicate]
- How to convert a dataframe to a dictionary
- Convert Pandas Dataframe to nested JSON
- Pandas DataFrame to List of Dictionaries
- How to convert an XML string to a dictionary?
- Pandas read nested json
- Storing Python dictionaries
- How to dump a dict to a JSON file?
- Python – How to convert JSON File to Dataframe
- How to flatten a pandas dataframe with some columns as json?
- How can I access the nested data in this complex JSON, which includes another JSON document as one of the strings?
- How to flatten a nested JSON recursively, with flatten_json
- Nested dictionary to multiindex dataframe where dictionary keys are column labels
- String to Dictionary in Python [duplicate]
- Convert numpy type to python
- How to normalize json correctly by Python Pandas
- Convert a python dict to a string and back
- Pandas groupby.size vs series.value_counts vs collections.Counter with multiple series
- How to flatten multilevel/nested JSON?
- pandas.io.json.json_normalize with very nested json
- FastAPI is very slow in returning a large amount of JSON data
- pandas groupby to nested json
- How to create a dictionary of two pandas DataFrame columns
- JSON object must be str, bytes or bytearray, not dict
- pandas read_json: “If using all scalar values, you must pass an index”
- Unpack dictionary from Pandas Column
- How to convert a dataframe to a dictionary
- How to completely traverse a complex dictionary of unknown depth?
- Python: Read several json files from a folder
- Nested Dictionary to MultiIndex pandas DataFrame (3 level)
- Pandas DataFrame performance
- Reading multiple JSON records into a Pandas dataframe
- Pretty print JSON dumps
- Creating a dictionary from a csv file?
- How do I merge a list of dicts into a single dict?
- How to overcome TypeError: unhashable type: ‘list’
- Pandas every nth row
- How to recursively find specific key in nested JSON?
- How can I create the minimum size executable with pyinstaller?