liveBook · Manning

Data frame

As explained in Effective Data Analysis

A dataframe is a tabular data structure with labeled rows and columns that can hold variables of different types.

A data frame is a tabular structure with labeled rows and columns that can hold variables of different types. It turns nested API responses or scraped HTML into a workable dataset for analysis, reporting, and stakeholder-facing workflows. section 10.1.1 section 10.2.2

A typical workflow builds a data frame from selected fields, cleans text into usable values, converts columns to appropriate types, and aggregates records for the question at hand. A forecast may become one row per day with low temperature, high temperature, and maximum wind speed. section 10.1.1 section 10.2.2

Use a data frame to:

Seven-day forecast

After retrieving a weather response, construct a pandas data frame from forecast periods, retain end time, temperature, and wind speed, convert end times to dates, parse numeric wind speeds, and aggregate records by day. section 10.1.1

import pandas as pd    #1

forecast_df = pd.DataFrame(forecast["properties"]["periods"])    #2
forecast_df[
    ["endTime", "isDaytime", "temperature", "windSpeed"]
].head()   #3

Inspect the compact pandas operation that converts forecast-period records into a data frame and previews selected columns. section 10.1.1

How Effective Data Analysis covers it

How deep it goes
Explains construction, field selection, parsing, type conversion, and aggregation, but does not develop dataframe internals.
Examples
Uses seven-day weather forecasts, nested JSON responses, scraped forecast cards, temperature and wind-speed parsing, and daily summaries.
What it assumes
Assumes Python familiarity and introduces requests, JSON inspection, BeautifulSoup extraction, regular expressions, and pandas operations.
What you can do after
Builds pandas data frames from API or HTML records, cleans columns, and produces grouped summaries for analysis.
How it connects
Connects data frames with APIs, JSON, web scraping, regular expressions, data cleaning, aggregation, and data visualization.

Also explained in

Compare how 19 books explain data frame →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Data Analysis. The section links point to the parts of the book it draws on.