Which function is used to read a JSON file into a DataFrame?
A
pd.load_json() B
pd.read_json() C
pd.json_read() D
pd.import_json()
Analysis & Theory
The correct function to read JSON files in Pandas is `pd.read_json()`.
What type of object does `pd.read_json()` return?
A
Series B
Dictionary C
List D
DataFrame
Analysis & Theory
`pd.read_json()` reads the JSON data and returns a Pandas DataFrame.
What is the default JSON format expected by `read_json()`?
A
records B
split C
columns D
orient='columns'
Analysis & Theory
By default, `read_json()` assumes the JSON is in `columns` orientation.
Which parameter lets you change the expected format of the JSON?
A
format= B
type= C
orient= D
style=
Analysis & Theory
`orient` specifies the expected format (like 'records', 'split', 'index', etc.).
Which orientation is used when JSON is a list of dictionaries?
A
index B
split C
records D
columns
Analysis & Theory
A list of dictionaries corresponds to the `records` orientation.
How do you read a JSON file named 'data.json'?
A
pd.read_json('data.json') B
pd.read.json('data.json') C
pd.open_json('data.json') D
pd.load('data.json')
Analysis & Theory
You use `pd.read_json('data.json')` to load JSON files from disk.
What happens if the JSON structure is not flat (i.e., nested)?
A
It causes an error B
It is read as NaN C
Pandas will flatten it automatically D
You may need normalization
Analysis & Theory
Nested JSON may require flattening using `json_normalize()` or preprocessing.
Which module can help normalize deeply nested JSON for Pandas?
A
json B
pandas.io.json C
pandas.json_normalize D
pandas.json_flat
Analysis & Theory
`pandas.json_normalize()` helps convert nested JSON into flat DataFrames.
How do you read JSON data from a URL?
A
pd.read_json(url) B
pd.read_json_from_url(url) C
pd.read_url_json(url) D
pd.read_json(url=url)
Analysis & Theory
`pd.read_json()` accepts both file paths and URLs directly.
What does `lines=True` do in `read_json()`?
A
Reads line by line JSON arrays B
Reads JSON strings only C
Allows reading JSON with one object per line D
Skips lines in the file
Analysis & Theory
`lines=True` is used for JSON Lines format (one JSON object per line).