pandas-plots 0.11.10__py3-none-any.whl → 0.11.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pandas_plots/tbl.py +13 -7
- {pandas_plots-0.11.10.dist-info → pandas_plots-0.11.12.dist-info}/METADATA +3 -1
- pandas_plots-0.11.12.dist-info/RECORD +10 -0
- pandas_plots-0.11.10.dist-info/RECORD +0 -10
- {pandas_plots-0.11.10.dist-info → pandas_plots-0.11.12.dist-info}/LICENSE +0 -0
- {pandas_plots-0.11.10.dist-info → pandas_plots-0.11.12.dist-info}/WHEEL +0 -0
- {pandas_plots-0.11.10.dist-info → pandas_plots-0.11.12.dist-info}/top_level.txt +0 -0
pandas_plots/tbl.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
import warnings
|
2
|
-
|
3
|
-
warnings.filterwarnings("ignore")
|
1
|
+
# import warnings
|
2
|
+
# warnings.filterwarnings("ignore")
|
4
3
|
|
5
4
|
import math
|
6
5
|
import os
|
@@ -16,6 +15,8 @@ from scipy import stats
|
|
16
15
|
|
17
16
|
from .hlp import wrap_text
|
18
17
|
|
18
|
+
import duckdb as ddb
|
19
|
+
|
19
20
|
# from devtools import debug
|
20
21
|
|
21
22
|
pd.options.display.colheader_justify = "right"
|
@@ -29,12 +30,16 @@ KPI_LITERAL = Literal[
|
|
29
30
|
]
|
30
31
|
|
31
32
|
|
33
|
+
def descr_db(db: ddb.duckdb.DuckDBPyRelation, caption: str = "db")->None:
|
34
|
+
cols = ", ".join(db.columns)
|
35
|
+
print(f'🗄️ {caption}\t{db.count("*").fetchone()[0]:_}, {db.columns.__len__()}\n\t("{cols}")')
|
36
|
+
|
32
37
|
def describe_df(
|
33
38
|
df: pd.DataFrame,
|
34
39
|
caption: str,
|
35
40
|
use_plot: bool = True,
|
36
41
|
use_columns: bool = True,
|
37
|
-
use_missing: bool =
|
42
|
+
use_missing: bool = False,
|
38
43
|
renderer: Literal["png", "svg", None] = "png",
|
39
44
|
fig_cols: int = 3,
|
40
45
|
fig_offset: int = None,
|
@@ -52,7 +57,7 @@ def describe_df(
|
|
52
57
|
caption (str): caption to describe dataframe
|
53
58
|
use_plot (bool): display plot?
|
54
59
|
use_columns (bool): display columns values?
|
55
|
-
use_missing (bool): display missing values? (
|
60
|
+
use_missing (bool): display missing values? (no support for dark theme)
|
56
61
|
renderer (Literal["png", "svg", None]): renderer for plot
|
57
62
|
fig_cols (int): number of columns in plot
|
58
63
|
fig_offset (int): offset for plots as iloc Argument. None = no offset, -1 = omit last plot
|
@@ -77,7 +82,8 @@ def describe_df(
|
|
77
82
|
hint: skewness may not properly work if the columns is float and/or has only 1 value
|
78
83
|
"""
|
79
84
|
# * copy df, df col types are modified
|
80
|
-
df = df.copy()
|
85
|
+
df = df.fillna(pd.NA).copy()
|
86
|
+
df_ = df.copy()
|
81
87
|
|
82
88
|
# * check if df is empty
|
83
89
|
if len(df) == 0:
|
@@ -210,7 +216,7 @@ def describe_df(
|
|
210
216
|
|
211
217
|
if use_missing:
|
212
218
|
import missingno as msno
|
213
|
-
msno.matrix(
|
219
|
+
msno.matrix(df_, figsize=(12, 5))
|
214
220
|
|
215
221
|
|
216
222
|
def pivot_df(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pandas-plots
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.12
|
4
4
|
Summary: A collection of helper for table handling and vizualization
|
5
5
|
Home-page: https://github.com/smeisegeier/pandas-plots
|
6
6
|
Author: smeisegeier
|
@@ -28,6 +28,7 @@ Requires-Dist: Jinja2 >=3.1.4
|
|
28
28
|
Requires-Dist: requests >=2.32.0
|
29
29
|
Requires-Dist: numpy <2.0.0
|
30
30
|
Requires-Dist: missingno >=0.5.2
|
31
|
+
Requires-Dist: duckdb >=1.0.0
|
31
32
|
|
32
33
|
# pandas-plots
|
33
34
|
|
@@ -78,6 +79,7 @@ tbl.show_num_df(
|
|
78
79
|
- `tbl` utilities for table descriptions
|
79
80
|
- 🌟`show_num_df()` displays a table as styled version with additional information
|
80
81
|
- `describe_df()` an alternative version of pandas `describe()` function
|
82
|
+
- `descr_db()` a very short descr for a `duckdb` relation
|
81
83
|
- `pivot_df()` gets a pivot table of a 3 column dataframe (or 2 columns if no weights are given)
|
82
84
|
|
83
85
|
- `pls` for plotly visualizations
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pandas_plots/hlp.py,sha256=Ug3RGok3Bn_FiPjfmd-_gNskSfzfVplQKR1XQFeykHA,11898
|
2
|
+
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
+
pandas_plots/pls.py,sha256=BzZge7TnECjCs47MZ7P63_y2WU23P9sLaMl7SKB5h1Q,35043
|
4
|
+
pandas_plots/tbl.py,sha256=NU-kN5tBa1o49J7HApU4jy7YJeC5O5ROG7B3b3WaYZ8,24475
|
5
|
+
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
+
pandas_plots-0.11.12.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
+
pandas_plots-0.11.12.dist-info/METADATA,sha256=2RirsfBKN4SyGIcRs9SJXlDhyZh3rF0ojZFPOaDFeEc,6948
|
8
|
+
pandas_plots-0.11.12.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
9
|
+
pandas_plots-0.11.12.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
+
pandas_plots-0.11.12.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pandas_plots/hlp.py,sha256=Ug3RGok3Bn_FiPjfmd-_gNskSfzfVplQKR1XQFeykHA,11898
|
2
|
-
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
-
pandas_plots/pls.py,sha256=BzZge7TnECjCs47MZ7P63_y2WU23P9sLaMl7SKB5h1Q,35043
|
4
|
-
pandas_plots/tbl.py,sha256=ZBxPSX1eoomHkV0o4Zb9X3-M1FL8mVo3uRsRhD6qkP4,24205
|
5
|
-
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
-
pandas_plots-0.11.10.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
-
pandas_plots-0.11.10.dist-info/METADATA,sha256=haQKrp5-b391Iqmrjsm5N0BoQ7rbWLCPTAHZrKXT4Ko,6858
|
8
|
-
pandas_plots-0.11.10.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
9
|
-
pandas_plots-0.11.10.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
-
pandas_plots-0.11.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|