🔬 Simple data inspection tools for Polars - basic X-ray analysis and utilities for DataFrames.
Project description
🔬 Polarscope
Simple data inspection tools for Polars 🐻❄️
Polarscope is a basic data analysis library for Polars DataFrames. It provides an xray() function for data inspection and some plotting utilities. Still early in development with more features planned.
✨ Current Features
🔬 Data Inspection (xray)
- Summary statistics for numeric columns by default.
- Optional
include='all'support for mixed-type data. - Optional expanded output (
expanded=True) with normality/uniformity tests, outlier metrics, usability flags, and correlation details. - Great Tables output (
great_tables=True) or plain Polars DataFrame output (great_tables=False).
📊 Built-in Datasets
from polarscope.datasets import titanic, diabetes- Includes loader helpers and dataset metadata.
🧹 Utilities
- Column name cleaning (
clean_column_names) - Datatype optimization (
convert_datatypes) - Missing value dropping (
drop_missing) - Correlation/missing/distribution/categorical plots
✅ Polars-Only Data Handling
- Data handling is implemented with Polars.
- No Pandas is required for core data processing.
🚀 Quick Start
Installation
pip install polarscope
Optional extras:
pip install "polarscope[all]" # plotly + altair + scipy helpers
pip install "polarscope[dev]" # pytest + coverage tools
Basic Usage
import polars as pl
import polarscope as ps
from polarscope.datasets import titanic
# Use a built-in dataset or load your own
df = titanic()
# df = pl.read_csv("your_data.csv")
# Get basic data summary
ps.xray(df)
# More detailed analysis
ps.xray(df, expanded=True)
# Custom title and correlation analysis
ps.xray(df, title="My Data Analysis", corr_target="Survived")
Common xray() Options
ps.xray(
df,
include="all", # include all columns (not only numeric)
expanded=True, # additional stats/tests/quality fields
corr_target="column_name", # correlation against target column
outlier_method="iqr", # or "percentile"/"zscore"
percentiles=[0.1, 0.5, 0.9], # custom percentiles
decimals=2,
great_tables=False # return Polars DataFrame
)
🩺 Troubleshooting
Notebook still uses old code
If you changed source code locally but notebooks still show old behavior, reinstall in the same interpreter and restart kernel:
import sys, subprocess
subprocess.check_call([sys.executable, "-m", "pip", "install", "-e", "/path/to/polarscope"])
ValueError: Only the x-axis of a nanoplot allows strings
This comes from Great Tables nanoplot rendering when unsupported payloads reach the renderer. Update to latest local source and restart kernel.
🤝 Contributing
This is a small project, but contributions are welcome! Feel free to report bugs or suggest improvements.
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
Inspired by klib and built with great_tables.
🔬 A simple tool for basic Polars data inspection.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polarscope-1.6.1.tar.gz.
File metadata
- Download URL: polarscope-1.6.1.tar.gz
- Upload date:
- Size: 520.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fe299060805beb35504e479d6222f0db702929f4feeb8502f5757e89c57a306
|
|
| MD5 |
ea048360a93bd851b21c6cb288d615e1
|
|
| BLAKE2b-256 |
e2d3fa5985581784d8e9e7fdd3166513698c7335cd9658bc69ddec24124a53cd
|
Provenance
The following attestation bundles were made for polarscope-1.6.1.tar.gz:
Publisher:
publish.yml on pytoned/polarscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polarscope-1.6.1.tar.gz -
Subject digest:
4fe299060805beb35504e479d6222f0db702929f4feeb8502f5757e89c57a306 - Sigstore transparency entry: 1950544311
- Sigstore integration time:
-
Permalink:
pytoned/polarscope@fd62f6cec190b394805f037590c55d115be7743d -
Branch / Tag:
refs/tags/v1.6.1 - Owner: https://github.com/pytoned
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fd62f6cec190b394805f037590c55d115be7743d -
Trigger Event:
push
-
Statement type:
File details
Details for the file polarscope-1.6.1-py3-none-any.whl.
File metadata
- Download URL: polarscope-1.6.1-py3-none-any.whl
- Upload date:
- Size: 521.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40ca152089fe0435e4b445a031d05cfaf4d1807363dd4a175c90d3b77f63c6c3
|
|
| MD5 |
670b4dcc0bfd5e8a5930473f0ba35eba
|
|
| BLAKE2b-256 |
651a2870458c68fd14c371f380d6da275a8d6f1f081ef25172773abc6a689166
|
Provenance
The following attestation bundles were made for polarscope-1.6.1-py3-none-any.whl:
Publisher:
publish.yml on pytoned/polarscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polarscope-1.6.1-py3-none-any.whl -
Subject digest:
40ca152089fe0435e4b445a031d05cfaf4d1807363dd4a175c90d3b77f63c6c3 - Sigstore transparency entry: 1950544571
- Sigstore integration time:
-
Permalink:
pytoned/polarscope@fd62f6cec190b394805f037590c55d115be7743d -
Branch / Tag:
refs/tags/v1.6.1 - Owner: https://github.com/pytoned
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fd62f6cec190b394805f037590c55d115be7743d -
Trigger Event:
push
-
Statement type: