liveBook · Manning

Data frame

As explained in Build Python Web Apps with Streamlit

A dataframe is a two-dimensional tabular data structure organized into rows and columns, with each column holding values of a data type.

A data frame is a two-dimensional table organized into rows and columns. Each column stores values of a data type, such as strings, integers, or floating-point numbers. In pandas, data frames provide a practical structure for ingesting, manipulating, and analyzing tabular data. section 1.3.7 section 6.2.1

Common data-frame tasks include:

  • Load structured data with pandas read_csv, inspect its Python type and schema with type() and info(), and review sample rows with head(). section 6.2.1 section 6.2.2
  • Select columns and filter rows with square-bracket notation, then use the resulting data frame in analysis or a dashboard. section 6.6

Load and preview sales data

Import pandas as pd, load sales_data.csv into df with pd.read_csv('sales_data.csv'), and pass df.head(5) to Streamlit's st.write. The app then displays the first five rows so you can verify that the data loaded correctly. section 6.2.1 section 6.2.2

Figure 1.7 An editable pandas dataframe displayed in Streamlit (see chapter_01/data_editor_example.py in the GitHub repository).

View an editable pandas data frame rendered directly in a Streamlit application. section 1.3.7

How Build Python Web Apps with Streamlit covers it

How deep it goes
Defines rows, columns, and data types, then demonstrates loading, inspection, selection, filtering, and previewing; advanced pandas details remain deferred.
Examples
Uses sales_data.csv, pandas read_csv, df.info(), df.head(), selected sales columns, and editable Streamlit data frames.
What it assumes
Assumes basic Python execution and CSV access while teaching pandas installation, imports, dataframe structure, and initial inspection from the beginning.
What you can do after
Build a basic data workflow that loads a CSV, inspects its schema, selects data, and previews the result in Streamlit.
How it connects
Connects pandas with CSV files, Streamlit, data visualization, column selection, filtering, and groupby aggregation.

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 Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.