Skip to content
dreamcode
dreamcode
Map
Pandas DataFrames
Lesson 74 of 77
+15 XP on finish
PYTHON APPLIEDChapter 13 · Python for Data Science

Tabular data with Pandas DataFrames

Pandas builds on NumPy to provide DataFrames, two-dimensional labeled tables. You can load data from CSV files, filter rows, select columns, and compute aggregates with concise syntax.

Worked example

How it reads

  • pd.DataFrame(data) creates a table from a dictionary of columns
  • df[df['distance_ly'] < 100] filters rows where the condition is True
  • .idxmin() finds the index of the minimum value in a column
Cloud tip: Use df.info() to see column types and missing value counts, and df.describe() for statistical summaries of every numeric column.
main.py
PYTHON
real Python, runs in your browser
Console
Run your code to see its output here.
YOUR TURN

Add an altitude_km column (the metres divided by 1000), then print clouds["altitude_km"].tolist().

Press Run to check your work.