About Lesson
Once you have a DataFrame, it is important to inspect its structure and contents.
1. Viewing the First and Last Few Rows
print(df.head()) # View the first 5 rows by default
print(df.tail(3)) # View the last 3 rows
2. Getting DataFrame Information
print(df.info()) # Shows the data types, number of non-null entries, and memory usage
3. Displaying Summary Statistics
To get a quick overview of the numerical data:
print(df.describe()) # Summary statistics for numeric columns