pandas-plots 0.11.24__tar.gz → 0.11.26__tar.gz
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-0.11.24/src/pandas_plots.egg-info → pandas_plots-0.11.26}/PKG-INFO +4 -3
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/setup.cfg +4 -3
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots/tbl.py +39 -5
- {pandas_plots-0.11.24 → pandas_plots-0.11.26/src/pandas_plots.egg-info}/PKG-INFO +4 -3
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots.egg-info/requires.txt +2 -1
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/LICENSE +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/README.md +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/pyproject.toml +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots/hlp.py +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots/pii.py +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots/pls.py +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots/ven.py +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots.egg-info/SOURCES.txt +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots.egg-info/dependency_links.txt +0 -0
- {pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots.egg-info/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pandas-plots
|
3
|
-
Version: 0.11.
|
4
|
-
Summary: A collection of helper for table handling and
|
3
|
+
Version: 0.11.26
|
4
|
+
Summary: A collection of helper for table handling and visualization
|
5
5
|
Home-page: https://github.com/smeisegeier/pandas-plots
|
6
6
|
Author: smeisegeier
|
7
7
|
Author-email: dexterDSDo@googlemail.com
|
@@ -29,8 +29,9 @@ Requires-Dist: requests>=2.32.0
|
|
29
29
|
Requires-Dist: numpy<2.0.0
|
30
30
|
Requires-Dist: missingno>=0.5.2
|
31
31
|
Requires-Dist: duckdb>=1.0.0
|
32
|
-
Requires-Dist: kaleido>=0.2.
|
32
|
+
Requires-Dist: kaleido>=0.2.0
|
33
33
|
Requires-Dist: nbformat>=4.2.0
|
34
|
+
Requires-Dist: dataframe_image==0.2.3
|
34
35
|
|
35
36
|
# pandas-plots
|
36
37
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
[metadata]
|
2
2
|
name = pandas-plots
|
3
|
-
version = 0.11.
|
3
|
+
version = 0.11.26
|
4
4
|
author = smeisegeier
|
5
5
|
author_email = dexterDSDo@googlemail.com
|
6
|
-
description = A collection of helper for table handling and
|
6
|
+
description = A collection of helper for table handling and visualization
|
7
7
|
long_description = file: README.md
|
8
8
|
long_description_content_type = text/markdown
|
9
9
|
license = MIT License
|
@@ -35,8 +35,9 @@ install_requires =
|
|
35
35
|
numpy < 2.0.0
|
36
36
|
missingno >= 0.5.2
|
37
37
|
duckdb >= 1.0.0
|
38
|
-
kaleido >= 0.2.
|
38
|
+
kaleido >= 0.2.0
|
39
39
|
nbformat >= 4.2.0
|
40
|
+
dataframe_image == 0.2.3
|
40
41
|
|
41
42
|
[egg_info]
|
42
43
|
tag_build =
|
@@ -4,6 +4,7 @@
|
|
4
4
|
import math
|
5
5
|
import os
|
6
6
|
from collections import abc
|
7
|
+
from pathlib import Path
|
7
8
|
from typing import Literal, get_args
|
8
9
|
import numpy as np
|
9
10
|
|
@@ -12,6 +13,7 @@ import pandas as pd
|
|
12
13
|
import plotly.express as px
|
13
14
|
from plotly.subplots import make_subplots
|
14
15
|
from scipy import stats
|
16
|
+
import dataframe_image as dfi
|
15
17
|
|
16
18
|
from .hlp import wrap_text
|
17
19
|
|
@@ -268,6 +270,11 @@ def pivot_df(
|
|
268
270
|
kpi_rag_list: list[float] = None,
|
269
271
|
kpi_mode: KPI_LITERAL = None,
|
270
272
|
kpi_shape: Literal["squad", "circle"] = "squad",
|
273
|
+
show_as_pct: bool = False,
|
274
|
+
alter_font: bool = True,
|
275
|
+
font_size_th: int = 0,
|
276
|
+
font_size_td: int = 0,
|
277
|
+
png_path: str | Path = None,
|
271
278
|
) -> pd.DataFrame:
|
272
279
|
"""
|
273
280
|
A function to pivot a DataFrame based on specified parameters hand over to the *show_num_df* function.
|
@@ -299,6 +306,11 @@ def pivot_df(
|
|
299
306
|
max_min_x: max value green, min valued red for x axis
|
300
307
|
kpi_rag_list: a list of floats indicating the thresholds for rag lights. The list should have 2 elements.
|
301
308
|
kpi_shape: a Literal indicating the shape of the KPIs ["squad", "circle"]
|
309
|
+
show_as_pct (bool, optional): Whether to show values as percentages. Defaults to False.
|
310
|
+
alter_font (bool, optional): Whether to alter the font. Defaults to True.
|
311
|
+
font_size_th (int, optional): The font size for the header. Defaults to 0.
|
312
|
+
font_size_td (int, optional): The font size for the table data. Defaults to 0.
|
313
|
+
png_path (str | Path, optional): The path to save the output PNG file. Defaults to None.
|
302
314
|
|
303
315
|
Returns:
|
304
316
|
pd.DataFrame: The pivoted DataFrame.
|
@@ -380,6 +392,11 @@ def pivot_df(
|
|
380
392
|
kpi_mode=kpi_mode,
|
381
393
|
kpi_rag_list=kpi_rag_list,
|
382
394
|
kpi_shape=kpi_shape,
|
395
|
+
show_as_pct=show_as_pct,
|
396
|
+
alter_font=alter_font,
|
397
|
+
font_size_th=font_size_th,
|
398
|
+
font_size_td=font_size_td,
|
399
|
+
png_path=png_path,
|
383
400
|
)
|
384
401
|
|
385
402
|
|
@@ -398,6 +415,9 @@ def show_num_df(
|
|
398
415
|
kpi_shape: Literal["squad", "circle"] = "squad",
|
399
416
|
show_as_pct: bool = False,
|
400
417
|
alter_font: bool = True,
|
418
|
+
font_size_th: int = 0,
|
419
|
+
font_size_td: int = 0,
|
420
|
+
png_path: str | Path = None,
|
401
421
|
):
|
402
422
|
"""
|
403
423
|
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.
|
@@ -423,6 +443,9 @@ def show_num_df(
|
|
423
443
|
- kpi_shape: a Literal indicating the shape of the KPIs ["squad", "circle"]
|
424
444
|
- show_as_pct: a boolean indicating whether to show value as percentage (only advised on values ~1)
|
425
445
|
- alter_font: a boolean indicating whether to alter the font family
|
446
|
+
- font_size_th: an integer indicating the font size for the header
|
447
|
+
- font_size_td: an integer indicating the font size for the table data
|
448
|
+
- png_path: a string or Path indicating the path to save the PNG file
|
426
449
|
|
427
450
|
The function returns a styled representation of the DataFrame.
|
428
451
|
"""
|
@@ -637,16 +660,23 @@ def show_num_df(
|
|
637
660
|
out.set_properties(**{"font-family": "Courier"})
|
638
661
|
|
639
662
|
# * apply fonts for th (inkl. index)
|
640
|
-
|
641
|
-
# ("font-size", "10pt"),
|
663
|
+
_props_th = [
|
642
664
|
# ("font-weight", "bold"),
|
643
|
-
# ("font-family", "Courier"),
|
644
665
|
("text-align", "right")
|
645
666
|
]
|
667
|
+
|
668
|
+
_props_td = [
|
669
|
+
("text-align", "right")
|
670
|
+
]
|
671
|
+
if font_size_th > 0:
|
672
|
+
_props_th.append(("font-size", f"{font_size_th}pt"))
|
673
|
+
if font_size_td > 0:
|
674
|
+
_props_td.append(("font-size", f"{font_size_td}pt"))
|
675
|
+
|
646
676
|
out.set_table_styles(
|
647
677
|
[
|
648
|
-
dict(selector="th", props=
|
649
|
-
|
678
|
+
dict(selector="th", props=_props_th),
|
679
|
+
dict(selector="td", props=_props_td),
|
650
680
|
]
|
651
681
|
)
|
652
682
|
|
@@ -657,6 +687,10 @@ def show_num_df(
|
|
657
687
|
subset=(df_orig.index, df_orig.columns) if total_exclude else None,
|
658
688
|
)
|
659
689
|
|
690
|
+
if png_path is not None:
|
691
|
+
# * 72dpi default is too low for high res displays
|
692
|
+
dfi.export(obj=out, filename=png_path, dpi=120)
|
693
|
+
|
660
694
|
return out
|
661
695
|
|
662
696
|
def print_summary(df: pd.DataFrame | pd.Series, name: str="🟠 "):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pandas-plots
|
3
|
-
Version: 0.11.
|
4
|
-
Summary: A collection of helper for table handling and
|
3
|
+
Version: 0.11.26
|
4
|
+
Summary: A collection of helper for table handling and visualization
|
5
5
|
Home-page: https://github.com/smeisegeier/pandas-plots
|
6
6
|
Author: smeisegeier
|
7
7
|
Author-email: dexterDSDo@googlemail.com
|
@@ -29,8 +29,9 @@ Requires-Dist: requests>=2.32.0
|
|
29
29
|
Requires-Dist: numpy<2.0.0
|
30
30
|
Requires-Dist: missingno>=0.5.2
|
31
31
|
Requires-Dist: duckdb>=1.0.0
|
32
|
-
Requires-Dist: kaleido>=0.2.
|
32
|
+
Requires-Dist: kaleido>=0.2.0
|
33
33
|
Requires-Dist: nbformat>=4.2.0
|
34
|
+
Requires-Dist: dataframe_image==0.2.3
|
34
35
|
|
35
36
|
# pandas-plots
|
36
37
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pandas_plots-0.11.24 → pandas_plots-0.11.26}/src/pandas_plots.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|