pandas-plots 0.15.6__py3-none-any.whl → 0.15.8__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
CHANGED
@@ -6,7 +6,7 @@ import os
|
|
6
6
|
from collections import abc
|
7
7
|
from pathlib import Path
|
8
8
|
from typing import Literal, get_args
|
9
|
-
import
|
9
|
+
from IPython.display import display, HTML
|
10
10
|
|
11
11
|
import numpy as np
|
12
12
|
import pandas as pd
|
@@ -15,7 +15,7 @@ from plotly.subplots import make_subplots
|
|
15
15
|
from scipy import stats
|
16
16
|
import dataframe_image as dfi
|
17
17
|
|
18
|
-
from .hlp import wrap_text
|
18
|
+
from .hlp import wrap_text
|
19
19
|
|
20
20
|
import duckdb as ddb
|
21
21
|
|
@@ -53,11 +53,21 @@ def descr_db(
|
|
53
53
|
-------
|
54
54
|
None
|
55
55
|
"""
|
56
|
+
|
57
|
+
# * ensure markdown is correctly rendered
|
58
|
+
is_print = (os.getenv("RENDERER") in ('png', 'svg'))
|
59
|
+
|
60
|
+
# * wide tables are not properly rendered in markdown
|
61
|
+
width = 220 if is_print else 2000
|
62
|
+
|
63
|
+
if is_print:
|
64
|
+
display(HTML("<br>"))
|
65
|
+
|
56
66
|
cols = ", ".join(db.columns)
|
57
67
|
print(f'🗄️ {caption}\t{db.count("*").fetchone()[0]:_}, {db.columns.__len__()}\n\t("{cols}")')
|
58
|
-
|
68
|
+
|
59
69
|
if use_preview:
|
60
|
-
db.limit(3).show(max_width=
|
70
|
+
db.limit(3).show(max_width=width)
|
61
71
|
return
|
62
72
|
|
63
73
|
def describe_df(
|
@@ -66,11 +76,11 @@ def describe_df(
|
|
66
76
|
use_plot: bool = True,
|
67
77
|
use_columns: bool = True,
|
68
78
|
use_missing: bool = False,
|
69
|
-
renderer: Literal["png", "svg", None] =
|
79
|
+
renderer: Literal["png", "svg", None] = None,
|
70
80
|
fig_cols: int = 5,
|
71
81
|
fig_offset: int = None,
|
72
82
|
fig_rowheight: int = 300,
|
73
|
-
fig_width: int =
|
83
|
+
fig_width: int = 300,
|
74
84
|
sort_mode: Literal["value", "index"] = "value",
|
75
85
|
top_n_uniques: int = 5,
|
76
86
|
top_n_chars_in_index: int = 0,
|
@@ -246,11 +256,14 @@ def describe_df(
|
|
246
256
|
# * add trace to fig, only data not layout, only 1 series
|
247
257
|
fig.add_trace(figsub["data"][0], row=_row, col=_col)
|
248
258
|
|
249
|
-
# * set template
|
259
|
+
# * set template and layout size
|
250
260
|
fig.update_layout(
|
251
|
-
template="plotly_dark" if os.getenv("THEME") == "dark" else "plotly"
|
261
|
+
template="plotly_dark" if os.getenv("THEME") == "dark" else "plotly",
|
262
|
+
width=fig_width * fig_cols, # <-- Set width here
|
263
|
+
height=fig_rowheight * fig_rows, # <-- Set height here
|
252
264
|
)
|
253
|
-
|
265
|
+
|
266
|
+
fig.show(renderer)
|
254
267
|
|
255
268
|
if use_missing:
|
256
269
|
import missingno as msno
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pandas-plots
|
3
|
-
Version: 0.15.
|
3
|
+
Version: 0.15.8
|
4
4
|
Summary: A collection of helper for table handling and visualization
|
5
5
|
Keywords: tables,pivot,plotly,venn,plot,vizualization
|
6
6
|
Author: smeisegeier
|
@@ -26,7 +26,7 @@ Requires-Dist: duckdb>=1.3.0
|
|
26
26
|
Requires-Dist: nbformat>=4.2.0
|
27
27
|
Requires-Dist: dataframe-image>=0.2.6
|
28
28
|
Requires-Dist: connection-helper>=0.12
|
29
|
-
Requires-Python:
|
29
|
+
Requires-Python: ~=3.12.0
|
30
30
|
Project-URL: Bug Tracker, https://github.com/smeisegeier/pandas-plots/issues
|
31
31
|
Project-URL: Homepage, https://github.com/smeisegeier/pandas-plots
|
32
32
|
Project-URL: Repository, https://github.com/smeisegeier/pandas-plots
|
@@ -2,8 +2,8 @@ pandas_plots/.DS_Store,sha256=e90dd27d76d30869e4b3244fc211ad13e2acf715d00902d8cc
|
|
2
2
|
pandas_plots/__init__.py,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
|
3
3
|
pandas_plots/hlp.py,sha256=cfcaeb54d6c7f6a32885d5cf4fe164b0ff959133a32346c6163e3b4b0e69dda6,21141
|
4
4
|
pandas_plots/pls.py,sha256=33d4f988d959cfb7a8ba0200f3f7a8e4f3d8ab3b9b398af5f76011d43b9e04c2,65031
|
5
|
-
pandas_plots/tbl.py,sha256=
|
5
|
+
pandas_plots/tbl.py,sha256=c8bb6b4799bbe57231feb0798797df0e22d97b354656baf92b0b29a8b6753174,33418
|
6
6
|
pandas_plots/ven.py,sha256=db1dc00a8daf49f3b7aba7eff94743434875489cadf160a1046804e520c27429,11673
|
7
|
-
pandas_plots-0.15.
|
8
|
-
pandas_plots-0.15.
|
9
|
-
pandas_plots-0.15.
|
7
|
+
pandas_plots-0.15.8.dist-info/WHEEL,sha256=2b400f346628f0064eb5bbf656b39df8dfcb092437ab08244409d295749b81a3,78
|
8
|
+
pandas_plots-0.15.8.dist-info/METADATA,sha256=26547f7e733fbb26b925ce4ba88a084b85525fe57f4346186b0d37eed2ab6a0f,8001
|
9
|
+
pandas_plots-0.15.8.dist-info/RECORD,,
|