THINK FIRST·CODE LATER

← Interactive Information Visualization
Chapter 2 · Week 2

Data Abstraction: Datasets, Attributes and Tidy Data

Answered 0/30 Correct 0
Sign in to save progress across devices
Q1

In Munzner's vocabulary, what is an item?

Q2

Which of the following is not one of Munzner's four basic dataset types?

Q3

Bike stations and the trips between them form which dataset type?

Q4

PM2.5 values interpolated on a regular grid covering the whole city are an example of:

Q5

What type of attribute is "district" (Lucheng, Ouhai, Longwan)?

Q6

Air-quality levels "good", "moderate", "unhealthy" are best classified as:

Q7

A sensor is identified by the number 104. What attribute type is the sensor number for visualization purposes?

Q8

Which attribute is cyclic?

Q9

"Change in energy use compared with last year" (from −30 % to +25 %) has which ordering direction?

Q10

Which Altair type code should you use for a column of air-quality levels ("good" < "moderate" < "unhealthy")?

Q11

Which statement describes tidy data?

Q12

A table has columns building, Jan, Feb, Mar (energy in kWh). Why is it not tidy?

Q13

Which pandas call converts the wide table building, Jan, Feb, Mar into long format?

Q14

A wide table has 3 buildings × 3 months, but one cell (Gym, Mar) is empty. After melt and dropna(subset=["kwh"]), how many rows remain?

Q15

Why does Altair work best with long (tidy) data?

Q16

After pd.read_csv("readings.csv"), the timestamp column has dtype object. What does this mean, and what should you do?

Q17

Which file format preserves column types and is efficient for large analytical datasets?

Q18

An API returns stations with nested objects like {"name": "S1", "status": {"bikes": 5}}. Which pandas function turns them into a flat table with a status.bikes column?

Q19

Stations have 0 of 10, 5 of 20 and 12 of 16 bikes. What is the system fill rate (total bikes / total capacity)?

Q20

A district column contains "Lucheng", " lucheng" and "LUCHENG". What happens if you group by it without cleaning?

Q21

A sensor reports PM2.5 = 2,400 µg/m³ for one hour while neighbours report 30–40. What is the best practice?

Q22

Sensors were offline for two weeks in July. For a monthly PM2.5 chart, which treatment is most honest?

Q23

A table mixes readings (sensor, time, pm25) with sensor metadata (sensor, district, installation date) repeated on every row. Which tidy-data rule does it violate, and what is the fix?

Q24

Which pandas expression counts the exact duplicate rows of df?

Q25

An AI assistant cleaned data with df = df.dropna() before computing average trip durations. What is a possible hidden problem?

Q26

Trips (one row per trip) are joined to a weather table that has one row per hour, using only the trip's date as the join key. What happens to the trip count?

Q27

Which of the following is a derived attribute?

Q28 Short answer

Describe the CityPulse bike-share data in Munzner's terms: identify at least two datasets (with their type), their items, keys and attributes, and classify each attribute (categorical/ordinal/quantitative/temporal; sequential, diverging or cyclic where relevant).

Q29 Short answer

Convert the wide table below into tidy long format (write the resulting rows), then write the pandas code for both directions. Which form would you give to Altair for a line chart per district, and which to a printed summary table?

district 2024 2025 2026
Lucheng 48.2 44.0 41.5
Ouhai 39.0 37.5 36.1
Q30 Short answer

You receive a CityPulse CSV of 9 raw readings with: one duplicated row, one missing PM2.5, one timestamp "not a date", one value −5, one value 2,400, and district names written "Lucheng", " ouhai", "LUCHENG". Write the cleaning steps (in order, with pandas calls), say how many rows survive, and what you would write in the project report.