This document provides notes on data handling and analysis using Pandas, covering key operations such as reading, cleaning, filtering, analyzing, grouping, merging, and exporting data. It includes code examples for each operation, demonstrating how to manipulate DataFrames effectively. The notes serve as a quick reference guide for performing common data tasks in Python with Pandas.
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 ratings0% found this document useful (0 votes)
5 views
Pandas Notes
This document provides notes on data handling and analysis using Pandas, covering key operations such as reading, cleaning, filtering, analyzing, grouping, merging, and exporting data. It includes code examples for each operation, demonstrating how to manipulate DataFrames effectively. The notes serve as a quick reference guide for performing common data tasks in Python with Pandas.
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/ 2
Pandas Notes - Data Handling & Analysis
Reading Data
- Use `pd.read_csv('file.csv')` to read CSV files.
- Use `pd.read_excel('file.xlsx')` to read Excel files. - Use `df.head()` to view the first 5 rows. - Use `df.tail()` to view the last 5 rows. - Use `df.info()` to see data types and non-null counts. Example: df = pd.read_csv('data.csv')
Cleaning Data
- Use `df.isnull().sum()` to check missing values.
- Fill missing data: `df.fillna(value)`. - Drop missing rows: `df.dropna()`. - Rename columns: `df.rename(columns={'old':'new'})`. Example: df['age'].fillna(df['age'].mean(), inplace=True)