We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Extracting Data

Data work can get messy fast, so a reliable workflow often uses 7 stages:

  1. Extract the raw data.
  2. Inspect its shape and types.
  3. Clean errors and inconsistencies.
  4. Transform it into a useful structure.
  5. Aggregate records into summaries.
  6. Analyze the results.
  7. Deliver the answer.

Click to play video

Let's practice extracting readings from a raw string. Python's str.split() method splits a string into a list using the provided separator:

raw_statuses = "true,false,false,true"
status_strings = raw_statuses.split(",")
# ["true", "false", "false", "true"]

Assignment

Fix the bug in the extract_statuses function.

Pass "," to the str.split() call so each status becomes its own string. The rest of the provided function converts them to booleans and returns a Pandas Series.