Analyze CSV files — load, inspect, clean, filter, aggregate, and summarize tabular data from CSV and TSV files. Use when the user has a CSV file and wants to understand its contents, find patterns, compute statistics, filter rows, or answer questions about the data, even if they just say "look at this spreadsheet" or "what's in this file."
Use this skill when the user needs to:
pip install pandas tabulate
Always start by inspecting the file before any analysis:
import pandas as pd
df = pd.read_csv("data.csv")
print(f"Shape: {df.shape[0]} rows × {df.shape[1]} columns\n")
print(f"Columns and types:\n{df.dtypes.to_string()}\n")
print(f"First 5 rows:\n{df.head().to_markdown(index=False)}\n")
missing = df.isnull().sum()
if missing.any():
print(f"Missing values:\n{missing[missing > 0].to_string()}")