Session Ready
Exercise

Accessing the data

Now that you know how to load a dataset object and explore it's metadata, you'll have access to three properties that let you access the data: raw_data, tables, and dataframes.

Each of these returns a dictionary of values, just in different formats: bytes, list and pandas.DataFrame objects, respectively. Use what makes sense for your use case, but note that not all files within a dataset on data.world are tabular, and therefore would only be returned with the raw_data response.

Let's practice creating a dataframe from a specific table in our dataset. Note that datadotworld is already imported and the dataset variable has been created with load_dataset:

Instructions
100 XP
  • Use the dataframes property to assign the alderman_votes table to the variable votes_dataframe.
  • Explore the data by printing out the dataframe's shape and first 3 rows.