JSON (JavaScript Object Notation) stores numbers, text, lists, and dictionaries in a readable, writable text format. It is smaller than XML, more expressive than CSV, and widely used for cross-platform internet APIs. section 3.20
A particularly useful shape is an array of objects—the Python equivalent of a list of dictionaries. With pandas, pd.read_json turns each object into a record and its keys into DataFrame columns. section 3.21
A small JSON-powered analysis can proceed as follows:
- Load data about the 1,000 largest United States cities with pd.read_json. section 3.20
- Compare mean and median populations with describe; the mean of 131,132 exceeds the median of 68,207 because a few large cities pull it upward. section 3.21
- Remove the 50 largest cities with loc and recompute the values: the mean falls to 87,027, while the median falls to 65,796. section 3.21
- Use maximum latitude to locate the northernmost city, then count state values to compare representation. section 3.21
df['population'].describe()[['mean', '50%']]
Inspect the compact pandas expression that selects mean and median population statistics. section 3.21


































