📊 dfglimpse
A quick, per-column glimpse of a pandas DataFrame for exploratory data analysis (EDA).
glimpse summarizes each column of a DataFrame in a single table — its dtype, how
many values are missing (count and percentage), how many unique values it has, and
either the full set of unique values or a short preview for high-cardinality columns.
Installation
pip install dfglimpse
Quick start
import pandas as pd
from dfglimpse import glimpse
df = pd.read_csv("sample_data.csv")
glimpse(df)
Output:
Column dtypes NaN Count NaN % Nunique Unique Values
Id int64 0 0.0 20 [1, 2, 3] ... (+17 more)
MSSubClass int64 0 0.0 5 [20, 60, 70, 50, 30]
MSZoning object 0 0.0 4 [RL, RM, C (all), RH]
LotFrontage float64 4 20.0 15 [65.0, 80.0, 70.0] ... (+12 more)
LotArea int64 0 0.0 20 [8450, 9600, 11250] ... (+17 more)
SaleCondition object 0 0.0 5 [Normal, Abnorml, Partial, AdjLand, Alloca]
The result is an ordinary DataFrame, so you can sort or filter it — for example,
glimpse(df).sort_values("NaN %", ascending=False) to find the columns with the most
missing values.
API
glimpse(df, columns=None, max_unique=10, n_samples=3) -> pandas.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
df |
pandas.DataFrame |
— | The DataFrame to inspect. |
columns |
list[str] | None |
None |
Subset of columns to inspect. None inspects every column. |
max_unique |
int |
10 |
Columns with at most this many unique values show every unique value; columns with more show a preview instead. |
n_samples |
int |
3 |
Number of sample values shown in the preview for high-cardinality columns. |
Returns a DataFrame with one row per column and the columns
Column, dtypes, NaN Count, NaN %, Nunique, Unique Values.
Missing values are excluded from Nunique and from the displayed unique values, so
they stay consistent with each other.
Requirements
- Python 3.10+
- pandas 2.0+
License
MIT License. See LICENSE.
日本語
dfglimpse は、pandas の DataFrame の各列を一望するための小さな EDA 補助ツールです。
glimpse(df) を呼ぶと、各列について以下を1つの表にまとめて返します。
- データ型(dtype)
- 欠損(NaN)数と割合(%)
- ユニークな値の個数(欠損は除外)
- ユニークな値の内容(多い列は先頭数件のプレビュー)
インストール
pip install dfglimpse
使い方
import pandas as pd
from dfglimpse import glimpse
df = pd.read_csv("sample_data.csv")
glimpse(df)
戻り値はただの DataFrame なので、glimpse(df).sort_values("NaN %", ascending=False)
のように並べ替え・絞り込みができます。
引数
| 引数 | 既定値 | 説明 |
|---|---|---|
df |
— | 対象の DataFrame |
columns |
None |
対象の列(リスト)。None で全列 |
max_unique |
10 |
この数以下なら全ユニーク値を表示。超えるとプレビュー表示 |
n_samples |
3 |
プレビュー時に見せるサンプル値の件数 |
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 dfglimpse-0.1.0.tar.gz.
File metadata
- Download URL: dfglimpse-0.1.0.tar.gz
- Upload date:
- Size: 43.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
774efd75a608960bb673670208ee81ac6e2cdcebf7f70f857e56efef6c213590
|
|
| MD5 |
f8b95329374795783dac83e798f8c377
|
|
| BLAKE2b-256 |
e51664983636bd23de6e857c848c50de3a089d77a829e16627f841bad9f5db39
|
File details
Details for the file dfglimpse-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dfglimpse-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13fd2d0573a385e5fae8917c67373973f3785312bb1e7b41f7480e14fa9a131e
|
|
| MD5 |
a07b7dae3a1cb5d908923ccd4784f5d1
|
|
| BLAKE2b-256 |
6f5f8b8e09092eef7168cd68a3dd6bad0bea69c0a74fc34658af4e5806f96ca7
|