-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathview_data.py
More file actions
36 lines (26 loc) · 1.5 KB
/
view_data.py
File metadata and controls
36 lines (26 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ─────────────────────────────────────────────────────────────
# sandbox_explore_parquet.py — Quick Parquet File Explorer
# ─────────────────────────────────────────────────────────────
# Lightweight inspection tool using pandas + pyarrow.
# Allows you to preview any Parquet file produced by the ETL pipeline.
# Works across Windows, macOS, and Linux.
# ─────────────────────────────────────────────────────────────
import pandas as pd
from pathlib import Path
# Base directory for modeled data
MODEL = Path("data/02-model")
# Choose which Parquet file to inspect
target = MODEL / "sales_by_customer.parquet" # change as needed
if not target.exists():
raise FileNotFoundError(f"❌ Parquet file not found: {target}")
print(f"📂 Reading: {target}")
# Load file (pyarrow backend is used automatically)
df = pd.read_parquet(target)
# Display basic information
print("\n=== HEAD (first 5 rows) ===")
print(df.head(), "\n")
print("=== INFO ===")
print(df.info(), "\n")
print("=== SUMMARY STATISTICS ===")
print(df.describe(include='all'), "\n")
print(f"✅ Loaded {len(df):,} rows × {len(df.columns)} columns")