🐼 Pandas : Map of Content

What is pandas?

pandas is an open-source Python library built on top of NumPy for fast, flexible, and expressive data structures (Series, DataFrame) designed to work with structured (tabular, labeled) data. It is the core tool for data cleaning, transformation, exploration, and analysis in the Python data stack.

import pandas as pd
import numpy as np

Version note

This vault assumes pandas ≥ 2.x. Where behavior changed from 1.x (e.g. Copy-on-Write, SettingWithCopyWarning, deprecated .append()), a callout flags it.


📂 Folder Contents

#NoteCovers
0101-Series1D labeled array, the building block of a DataFrame
0202-DataFrame-BasicsCreation, inspection, attributes, dtypes
0303-IO-Reading-WritingCSV, Excel, JSON, SQL, Parquet, clipboard
0404-Indexing-Selection.loc, .iloc, boolean masks, slicing, .at/.iat
0505-Missing-DataNaN, isna, fillna, dropna, interpolate
0606-GroupBySplit-apply-combine, aggregation, transform, filter
0707-Merge-Join-ConcatCombining DataFrames: merge, join, concat, append
0808-Reshapingpivot, pivot_table, melt, stack/unstack, crosstab
0909-String-MethodsThe .str accessor, regex, text cleaning
1010-DateTime.dt accessor, Timestamps, resampling, time series
1111-Apply-Map-Vectorizationapply, map, applymap, vectorization, pipe
1212-Aggregation-Statisticsdescribe, mean, corr, value_counts, agg funcs
1313-Sorting-Filteringsort_values, sort_index, query, nlargest
1414-MultiIndexHierarchical indexing, .xs, swaplevel
1515-Categorical-DataCategorical dtype, ordered categories, memory savings
1616-Window-Rolling-Expandingrolling, expanding, ewm
1717-Plotting.plot() accessor, matplotlib integration
1818-Options-Performancepd.options, memory, eval/query, vectorization tips
1919-Common-Errors-GotchasSettingWithCopyWarning, chained indexing, dtype traps

🗺️ Conceptual Map

graph TD
    A[pandas] --> B[Data Structures]
    A --> C[I/O]
    A --> D[Data Wrangling]
    A --> E[Analysis]

    B --> B1[Series]
    B --> B2[DataFrame]
    B --> B3[Index / MultiIndex]

    C --> C1[CSV / Excel / JSON]
    C --> C2[SQL]
    C --> C3[Parquet]

    D --> D1[Indexing & Selection]
    D --> D2[Missing Data]
    D --> D3[Merge / Join / Concat]
    D --> D4[Reshape: pivot / melt]
    D --> D5[String & DateTime]

    E --> E1[GroupBy]
    E --> E2[Aggregation & Stats]
    E --> E3[Window Functions]
    E --> E4[Plotting]

⚡ Quick Reference : Most-Used Calls

pd.read_csv("file.csv")            # load data
df.head() / df.tail()              # peek
df.info() / df.describe()          # summary
df.shape / df.columns / df.dtypes  # structure
df.loc[rows, cols]                 # label-based selection
df.iloc[rows, cols]                # position-based selection
df[df["col"] > 0]                  # boolean filter
df.groupby("col").agg(...)         # split-apply-combine
df.merge(other, on="key")          # SQL-style join
df.pivot_table(...)                # reshape + aggregate
df.dropna() / df.fillna(0)         # handle missing data
df.sort_values("col")              # sort
df.to_csv("out.csv", index=False)  # save

  • Excel Reference : for spreadsheet-side equivalents (VLOOKUP ≈ merge, Pivot Table ≈ pivot_table)
  • ML Study Notes : pandas is the primary data-prep tool referenced there

How to use this vault section

Each note follows the same skeleton: Definition → Syntax → Key Parameters → Examples → Notes/Gotchas. Use Ctrl/Cmd+O (Quick Switcher) and start typing “Pandas” to jump between notes.