5. pandas DataFrames and Series
5.2 head, info, dtypes
Steps in Jupyter
- Run the DataFrame code above.
df.head()— first 5 rows (here all 3).df.shape—(3, 7)means 3 rows, 7 columns.df.info()— non-null counts and dtypes.df.dtypes— column types only.df.describe()— numeric summary (qty, amount).df["city"]ordf.city— one Series.
What you should see. amount and qty as int64; text columns as object (string). Cancelled row still appears — filtering comes in Chapter 6.
Ravindra Bagale's Tip
Khup students df.city vaprun column names with spaces break kartat. Safe habit: df["order id"] square brackets. Spaces/asli columns rename karun order_id sara. Bilkul visru naka.