Member-only story
Top 7 Most Common Pandas Features You Should Know

Pandas is one of the most powerful and popular Python libraries for data manipulation and analysis. Whether you’re cleaning, transforming, or analyzing datasets, Pandas offers a wealth of functions that simplify your workflow. Below, we explore seven of the most common and useful features that every data scientist and analyst should know.
1. DataFrame Creation
The DataFrame is the core data structure in Pandas. It’s a two-dimensional, size-mutable, and heterogeneous tabular data structure with labeled axes (rows and columns). You can create a DataFrame from various data structures like lists, dictionaries, and NumPy arrays.
import pandas as pd
# Creating a DataFrame from a dictionary
data = {
'Name': ['Alice', 'Bob', 'Charlie'],
'Age': [25, 30, 35],
'Salary': [50000, 60000, 70000]
}
df = pd.DataFrame(data)
print(df)
Output:
Name Age Salary
0 Alice 25 50000
1 Bob 30 60000
2 Charlie 35 70000
2. Data Selection (loc
and iloc
)
Selecting data by label or position is fundamental when working with large datasets. Pandas provides two methods for accessing data from DataFrames: loc
(label-based indexing) and iloc
(integer-based indexing).
loc
: Use for label-based indexing.iloc
: Use for positional indexing.
# Selecting by label
print(df.loc[0]) # First row based on label
# Selecting by position
print(df.iloc[1]) # Second row based on position
3. Filtering Data
Filtering allows you to create subsets of data based on conditions. You can filter rows using conditional statements.
# Filter rows where Age is greater than 30
filtered_df = df[df['Age'] > 30]
print(filtered_df)
Output:
Name Age Salary
2 Charlie 35 70000
4. Handling Missing Data
Missing data is a common issue in real-world datasets. Pandas provides methods like isna()
, fillna()
, and dropna()
to handle missing values efficiently.
isna()
: Detect missing values.