Data Analysis with Pandas in Python
Learn how to use the Pandas library in Python for data analysis, including data frames, series, and data manipulation.
Introduction to Pandas
Pandas is a powerful library in Python for data analysis and manipulation.
Importing Pandas
You can import Pandas using the following command:
import pandas as pd
Creating Data Frames
A data frame is a two-dimensional table of data with rows and columns.
# create a data frame
data = {'Name': ['John', 'Anna', 'Peter', 'Linda'],
'Age': [28, 24, 35, 32],
'Country': ['USA', 'UK', 'Australia', 'Germany']}
df = pd.DataFrame(data)
print(df)
Data Manipulation
You can perform various operations on data frames, such as filtering, sorting, and grouping.
# filter the data
print(df[df['Age'] > 30])
# sort the data
print(df.sort_values('Age'))
Ready for more? These paid resources pick up where this lesson leaves off.
Project-based python video courses — the perfect paid next step after these free lessons.
Browse on Udemy →Hand-picked python books to master the fundamentals offline.
See on Amazon →Some links on this page are affiliate links: we may earn a commission at no extra cost to you. We only recommend tools we believe are genuinely useful.