pandas-plots 0.11.20__py3-none-any.whl → 0.11.22__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 +11 -2
- {pandas_plots-0.11.20.dist-info → pandas_plots-0.11.22.dist-info}/METADATA +1 -1
- pandas_plots-0.11.22.dist-info/RECORD +10 -0
- pandas_plots-0.11.20.dist-info/RECORD +0 -10
- {pandas_plots-0.11.20.dist-info → pandas_plots-0.11.22.dist-info}/LICENSE +0 -0
- {pandas_plots-0.11.20.dist-info → pandas_plots-0.11.22.dist-info}/WHEEL +0 -0
- {pandas_plots-0.11.20.dist-info → pandas_plots-0.11.22.dist-info}/top_level.txt +0 -0
pandas_plots/tbl.py
CHANGED
@@ -123,7 +123,13 @@ def describe_df(
|
|
123
123
|
print(f"🟣 shape: ({df.shape[0]:_}, {df.shape[1]}) columns: {np.array(df.columns)} ")
|
124
124
|
# print(f"🟣 shape: ({df.shape[0]:_}, {df.shape[1]}) columns: {df.columns.tolist()} ")
|
125
125
|
print(f"🟣 duplicates: {df.duplicated().sum():_}")
|
126
|
-
print(f"🟣
|
126
|
+
print(f"🟣 uniques: {wrap_text(str({col: f'{df[col].nunique():_}' for col in df})) }")
|
127
|
+
# print(f"🟣 uniques: { {col: f'{df[col].nunique():_}' for col in df} }")
|
128
|
+
# print(f"🟣 uniques: {{ {', '.join(f'{col}: {df[col].nunique():_}' for col in df)} }}")
|
129
|
+
print(f"🟣 missings: {wrap_text(str({col: f'{df[col].isna().sum():_}' for col in df})) }")
|
130
|
+
# print(f"🟣 missings: { {col: f'{df[col].isna().sum():_}' for col in df} }")
|
131
|
+
# print(f"🟣 missings: {dict(df.isna().sum())}")
|
132
|
+
|
127
133
|
|
128
134
|
def get_uniques_header(col: str):
|
129
135
|
# * sorting has issues when col is of mixed type (object)
|
@@ -391,6 +397,7 @@ def show_num_df(
|
|
391
397
|
kpi_mode: KPI_LITERAL = None,
|
392
398
|
kpi_shape: Literal["squad", "circle"] = "squad",
|
393
399
|
show_as_pct: bool = False,
|
400
|
+
alter_font: bool = True,
|
394
401
|
):
|
395
402
|
"""
|
396
403
|
A function to display a DataFrame with various options for styling and formatting, including the ability to show totals, apply data bar coloring, and control the display precision.
|
@@ -415,6 +422,7 @@ def show_num_df(
|
|
415
422
|
- kpi_rag_list: a list of floats indicating the thresholds for rag lights. The list should have 2 elements.
|
416
423
|
- kpi_shape: a Literal indicating the shape of the KPIs ["squad", "circle"]
|
417
424
|
- show_as_pct: a boolean indicating whether to show value as percentage (only advised on values ~1)
|
425
|
+
- alter_font: a boolean indicating whether to alter the font family
|
418
426
|
|
419
427
|
The function returns a styled representation of the DataFrame.
|
420
428
|
"""
|
@@ -625,7 +633,8 @@ def show_num_df(
|
|
625
633
|
out.format(formatter=formatter)
|
626
634
|
|
627
635
|
# * apply fonts for cells
|
628
|
-
|
636
|
+
if alter_font:
|
637
|
+
out.set_properties(**{"font-family": "Courier"})
|
629
638
|
|
630
639
|
# * apply fonts for th (inkl. index)
|
631
640
|
_props = [
|
@@ -0,0 +1,10 @@
|
|
1
|
+
pandas_plots/hlp.py,sha256=wrvy36rnSdg1I4uQjIzzwGmjcN0gvSfKylRf_7GKpXs,12001
|
2
|
+
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
+
pandas_plots/pls.py,sha256=C-EUvt9u7aXd6va7BGamf6HSODOnvbERwxu2Gb8PgbQ,35449
|
4
|
+
pandas_plots/tbl.py,sha256=A1SqvssDA4ofI_WJ-sdWIb9Bo5X-sELD8pley22Y4X4,28380
|
5
|
+
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
+
pandas_plots-0.11.22.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
+
pandas_plots-0.11.22.dist-info/METADATA,sha256=YgJjD4QfPZkLutuYg4_5orNjoVwNH2jx9nTsSwYqIlk,7071
|
8
|
+
pandas_plots-0.11.22.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
9
|
+
pandas_plots-0.11.22.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
+
pandas_plots-0.11.22.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
pandas_plots/hlp.py,sha256=wrvy36rnSdg1I4uQjIzzwGmjcN0gvSfKylRf_7GKpXs,12001
|
2
|
-
pandas_plots/pii.py,sha256=2WKE-W9s285jPdsTqCgt1uxuW4lj1PYCVOYB2fYDNwQ,2195
|
3
|
-
pandas_plots/pls.py,sha256=C-EUvt9u7aXd6va7BGamf6HSODOnvbERwxu2Gb8PgbQ,35449
|
4
|
-
pandas_plots/tbl.py,sha256=PuifjHBOXTH4OAIdEctGtyaD9IIybj9blasbw8udcho,27800
|
5
|
-
pandas_plots/ven.py,sha256=2x3ACo2vSfO3q6fv-UdDQ0h1SJyt8WChBGgE5SDCdCk,11673
|
6
|
-
pandas_plots-0.11.20.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
|
7
|
-
pandas_plots-0.11.20.dist-info/METADATA,sha256=wluzOws4R73y0i-3AWMJKGMwRL8NdaBpVEQF4HfLY5c,7071
|
8
|
-
pandas_plots-0.11.20.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
9
|
-
pandas_plots-0.11.20.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
|
10
|
-
pandas_plots-0.11.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|