Using info() to Check Column Types and Nulls in pandas
📖 Scenario: You work as a data analyst. You receive a small dataset about employees in a company. You want to quickly understand the data types of each column and check if there are any missing values.
🎯 Goal: Learn how to use the info() method in pandas to see column data types and count of non-null values.
📋 What You'll Learn
Create a pandas DataFrame with given employee data
Assign the DataFrame to a variable named
dfUse the
info() method on df to display column types and null countsPrint the output of
df.info()💡 Why This Matters
🌍 Real World
Data scientists and analysts often need to quickly understand the structure of new datasets, including data types and missing values, before starting analysis.
💼 Career
Knowing how to use pandas info() helps in data cleaning and preparation, which is a key skill for data science and analytics jobs.
Progress0 / 4 steps