Pandas is a fast, powerful, flexible, and easy-to-use open-source data analysis and manipulation tool built on top of the Python programming language.
pip install pandas
Or install it along with Jupyter and NumPy:
pip install jupyter pandas numpy
Use this command in your Python script or notebook:
import pandas as pd
Why as pd
? It allows you to use shorter aliases like pd.DataFrame()
.
A DataFrame is a 2D labeled data structure (like a table with rows and columns). Itβs the most used object in pandas.
import pandas as pd
data = {
"Name": ["Alice", "Bob", "Charlie"],
"Age": [25, 30, 35],
"City": ["Delhi", "Mumbai", "Bangalore"]
}
df = pd.DataFrame(data)
print(df)
Name Age City 0 Alice 25 Delhi 1 Bob 30 Mumbai 2 Charlie 35 Bangalore
df.head()
β Shows top 5 rowsdf.tail()
β Shows bottom 5 rowsdf.info()
β Displays structure infodf.describe()
β Shows statistical summarydf['ColumnName']
β Access a specific columndf = pd.read_csv("data.csv")
You can also read Excel, JSON, SQL, etc.
Pandas is your go-to toolkit for data wrangling in Python. Itβs intuitive, powerful, and a must-have skill in data science, machine learning, and analytics.
DataFrame indexing and filtering
to extract and work with specific data. Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!