0% found this document useful (0 votes)
17 views13 pages

Getting Started with Pandas._new

Pandas

Uploaded by

physizzmva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views13 pages

Getting Started with Pandas._new

Pandas

Uploaded by

physizzmva
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Getting Started with Pandas

YOUR FIRST STEP TOWARD DATA ANALYSIS IN PYTHON


What is Pandas?
Definition: Pandas is a Python library used for working with structured data.

Key Features:
◦ Easy-to-use tools for data cleaning, analysis, and transformation.
◦ Supports working with data in tables (like Excel).

Why the Name "Pandas?": Comes from "Panel Data," which means multi-
dimensional data.
Why Learn Pandas?
Important for Machine Learning and Data Science:
◦ Helps clean and prepare data for analysis.
◦ Makes exploring data faster and easier.

Saves Time:
◦ Automates repetitive tasks.
◦ Works efficiently with large datasets.
Pandas in Python and Machine Learning
Python Integration: Works well with libraries like NumPy and Matplotlib.
Machine Learning Use Cases:
◦ Load datasets (CSV, Excel, etc.).
◦ Clean missing or messy data.
◦ Prepare features for models.

Example:
Pandas Data Structures
• Series: A one-dimensional array with labels (like a column).

• Data Frame: A two-dimensional table with rows and columns.


Series Example
What is a Series?
Like a list, A Pandas Series is like a column in a table.
It is a one-dimensional array holding data of any type.
Example:

import pandas as pd
a = [1, 7, 2]
myvar = pd.Series(a)
print(myvar)
Series Example
Labels also possible
Like a list, but with labels.

Example:
DataFrame Example
What is a DataFrame?
◦ A table with rows and columns.
Example:

Output:
Loading and Exploring Data
Load a CSV File:

View Data:
Loading and Exploring Data
Load a CSV File:

View Data:
Cleaning Data
Handle Missing Values:

Remove Duplicates:
Transforming Data
Create New Columns:

Filter Data:

Group Data:
Real-World Example: Weather Dataset
Load the data:

Analyse temperature trends:

Filter for extreme conditions:

Export the filtered data:

You might also like