pandas-plots 0.11.10__tar.gz → 0.11.12__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.11.10
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
@@ -47,6 +47,7 @@ tbl.show_num_df(
47
47
  - `tbl` utilities for table descriptions
48
48
  - 🌟`show_num_df()` displays a table as styled version with additional information
49
49
  - `describe_df()` an alternative version of pandas `describe()` function
50
+ - `descr_db()` a very short descr for a `duckdb` relation
50
51
  - `pivot_df()` gets a pivot table of a 3 column dataframe (or 2 columns if no weights are given)
51
52
 
52
53
  - `pls` for plotly visualizations
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pandas-plots
3
- version = 0.11.10
3
+ version = 0.11.12
4
4
  author = smeisegeier
5
5
  author_email = dexterDSDo@googlemail.com
6
6
  description = A collection of helper for table handling and vizualization
@@ -34,6 +34,7 @@ install_requires =
34
34
  requests >= 2.32.0
35
35
  numpy < 2.0.0
36
36
  missingno >= 0.5.2
37
+ duckdb >= 1.0.0
37
38
 
38
39
  [egg_info]
39
40
  tag_build =
@@ -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 = True,
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? (looks better on light theme)
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(df, figsize=(12, 5))
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.10
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
@@ -7,3 +7,4 @@ Jinja2>=3.1.4
7
7
  requests>=2.32.0
8
8
  numpy<2.0.0
9
9
  missingno>=0.5.2
10
+ duckdb>=1.0.0
File without changes