Concept Flow - Basic DataFrame info (shape, dtypes, describe)
Create DataFrame
Check shape
Check dtypes
Run describe()
Review summary statistics
Start with a DataFrame, then check its size, data types, and summary statistics step-by-step.
import pandas as pd data = {'Age': [25, 30, 22], 'Name': ['Ann', 'Bob', 'Cal'], 'Score': [88.5, 92.0, 85.0]} df = pd.DataFrame(data) print(df.shape) print(df.dtypes) print(df.describe())
| Step | Action | Output Type | Output Value |
|---|---|---|---|
| 1 | Create DataFrame from dictionary | DataFrame | {'Age': [25,30,22], 'Name': ['Ann','Bob','Cal'], 'Score': [88.5,92.0,85.0]} |
| 2 | Check shape | tuple | (3, 3) |
| 3 | Check dtypes | Series | Age int64 Name object Score float64 dtype: object |
| 4 | Run describe() | DataFrame | Age Score count 3.000000 3.000000 mean 25.666667 88.500000 std 4.041452 3.511885 min 22.000000 85.000000 25% 23.500000 86.250000 50% 25.000000 88.500000 75% 27.500000 90.250000 max 30.000000 92.000000 |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4 |
|---|---|---|---|---|---|
| df | None | DataFrame with 3 rows and 3 columns | Same | Same | Same |
| shape | None | None | (3, 3) | (3, 3) | (3, 3) |
| dtypes | None | None | None | Age int64, Name object, Score float64 | Age int64, Name object, Score float64 |
| describe | None | None | None | None | Summary stats DataFrame for numeric columns |
Basic DataFrame info: - df.shape shows rows and columns count - df.dtypes shows data type per column - df.describe() summarizes numeric columns Use these to quickly understand your data size and types.