import pandas as pd
df = pd.read_csv('example.csv')
df| Name | Age | City | |
|---|---|---|---|
| 0 | Adil | 23 | Matannur |
| 1 | Aman | 19 | Vellore |
| 2 | Ziya | 15 | Tly |
| 3 | Zahra | 9 | Knr |
Mohammed Adil Siraju
September 16, 2025
This notebook covers essential operations on pandas DataFrames: reading, viewing, selecting, filtering, and indexing.
Load data from files like CSV into DataFrames using pd.read_csv().
Use head() and tail() to preview the first/last rows of your DataFrame.
Select specific columns using bracket notation or .loc.
Filter rows based on conditions using boolean indexing.
| Name | Age | City | |
|---|---|---|---|
| 0 | Adil | 23 | Matannur |
| 2 | Ziya | 15 | Tly |
| 3 | Zahra | 9 | Knr |
| Name | Age | City | |
|---|---|---|---|
| 2 | Ziya | 15 | Tly |
| 3 | Zahra | 9 | Knr |
Use .iloc for position-based and .loc for label-based indexing.
.copy() when assigning filtered DataFrames to avoid modifying originals.& and | for complex filters..loc for clarity in production code.This notebook covered key DataFrame operations: reading, viewing, selecting, filtering, and indexing. These form the foundation for data manipulation!