pandas is a Python library for manipulating and analyzing tabular data. Its central structure, the dataframe, represents rows and typed columns like a spreadsheet table, making structured data easier to load, inspect, select, and reshape. section 1.3.7 section 6.2.1
A practical pandas workflow includes:
- Install the library with pip, then import it conventionally as pd. section 6.2.1
- Load a CSV file into a dataframe with pd.read_csv('sales_data.csv'). section 6.2.1
- Inspect the result with type() and info(), including its row count, columns, data types, and memory usage. section 6.2.1
- Select columns with square-bracket notation, filter rows, and prepare data for analysis or visualization. section 6.2.1 section 6.6
Sales dashboard data
A metrics dashboard can load sales_data.csv into df, inspect more than a million sales records, and select fields such as date, product_name, segment, and state. pandas can then wrangle the data into forms suitable for Plotly line and pie charts displayed in Streamlit. section 6.2 section 6.5
>>> df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1035000 entries, 0 to 1034999
Data columns (total 10 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 date 1035000 non-null object
1 product_name 1035000 non-null object
2 segment 1035000 non-null object
3 category 1035000 non-null object
4 gender 1035000 non-null object
5 age_group 1035000 non-null object
6 state 1035000 non-null object
7 sales 1035000 non-null float64
8 gross_margin 1035000 non-null float64
9 transactions 1035000 non-null float64
dtypes: float64(3), object(7)
memory usage: 79.0+ MB
Inspect a dataframe’s structure through a concrete info() output showing rows, columns, types, non-null counts, and memory usage. section 6.2.1










