pandas-plots 0.8.12__py3-none-any.whl → 0.8.14__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/pls.py CHANGED
@@ -487,9 +487,11 @@ def plot_box(
487
487
  caption: str=None,
488
488
  title: str=None,
489
489
  violin: bool=False,
490
+ x_min: float=None,
491
+ x_max: float=None,
490
492
  ) -> None:
491
493
  """
492
- Plots a box plot for the given pandas Series.
494
+ Plots a horizontal box plot for the given pandas Series.
493
495
 
494
496
  Args:
495
497
  ser: The pandas Series to plot.
@@ -499,6 +501,8 @@ def plot_box(
499
501
  width: The width of the plot.
500
502
  annotations: Whether to add annotations to the plot.
501
503
  violin: Use violin plot or not
504
+ x_min: The minimum value for the x-axis scale (max and min must be set)
505
+ x_max: The maximum value for the x-axis scale (max and min must be set)
502
506
 
503
507
  Returns:
504
508
  None
@@ -536,6 +540,9 @@ def plot_box(
536
540
  }
537
541
 
538
542
  fig=px.violin(**{**dict,'box':True}) if violin else px.box(**dict)
543
+
544
+ if (x_min or x_min==0) and (x_max or x_max==0):
545
+ fig.update_xaxes(range=[x_min, x_max])
539
546
 
540
547
  # fig=px.violin(
541
548
  # ser,
@@ -556,6 +563,7 @@ def plot_box(
556
563
  fig.add_annotation(x=q75, text=f"q75: {round(q75,precision)}", showarrow=True, yshift=lvl2, y=-0)
557
564
  fig.add_annotation(x=fence1, text=f"upper: {round(fence1,precision)}", showarrow=True, yshift=lvl1, y=-0)
558
565
  fig.add_annotation(x=max, text=f"max: {round(max,precision)}", showarrow=True, yshift=lvl3, y=-0)
566
+
559
567
  fig.show('png')
560
568
  return
561
569
 
@@ -567,10 +575,10 @@ def plot_boxes(
567
575
  height: int = 600,
568
576
  width: int = 800,
569
577
  annotations: bool = True,
570
- title: str=None
578
+ title: str=None,
571
579
  ) -> None:
572
580
  """
573
- Plot boxes for each unique item in the DataFrame and add annotations for statistics.
581
+ [Experimental] Plot vertical boxes for each unique item in the DataFrame and add annotations for statistics.
574
582
 
575
583
  Args:
576
584
  df (pd.DataFrame): The input DataFrame with two columns, where the first column is string type and the second column is numeric.
@@ -648,5 +656,7 @@ def plot_boxes(
648
656
 
649
657
  fig.update_xaxes(title_text=df.columns[0])
650
658
  fig.update_yaxes(title_text=df.columns[1])
659
+
660
+
651
661
  fig.show("png")
652
662
  return
pandas_plots/tbl.py CHANGED
@@ -364,7 +364,7 @@ def show_num_df(
364
364
  print(f"❌ kpi_mode '{kpi_mode}' not supported")
365
365
  return
366
366
 
367
- if kpi_mode.startswith("rag") and (not isinstance(kpi_rag_list, abc.Iterable)
367
+ if (kpi_mode and kpi_mode.startswith("rag")) and (not isinstance(kpi_rag_list, abc.Iterable)
368
368
  or len(kpi_rag_list) != 2
369
369
  ):
370
370
  print(f"❌ kpi_rag_list must be a list of 2 if kpi_mode is set")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.8.12
3
+ Version: 0.8.14
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
@@ -0,0 +1,11 @@
1
+ pandas_plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pandas_plots/pls.py,sha256=f2YF73w-_k4BNsAQEZZ_BRziRg31NRqfYFxa_zGJau0,23698
3
+ pandas_plots/sql.py,sha256=SHrmwhmzq0QYygvaoKwv7neiwf_Rv87VmdUkADYPdR8,2485
4
+ pandas_plots/tbl.py,sha256=XV4n3zSHSN_99vmvIo2pU8kVKD5vjCd2IzWjtrBBEYA,21682
5
+ pandas_plots/txt.py,sha256=LnW9OF3mSX2fp9JajefF3Mz3LuCA8MaqlFZYjT_jaQw,1537
6
+ pandas_plots/ven.py,sha256=nDKS7cTIHOJhIXKnAxAkEoqPgVZCUPJld5CvSiB2JC4,11721
7
+ pandas_plots-0.8.14.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
8
+ pandas_plots-0.8.14.dist-info/METADATA,sha256=hMglPl56VSFj_gQt0gtw2XDccniZaoYM6cxsiuGMvFE,5856
9
+ pandas_plots-0.8.14.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
10
+ pandas_plots-0.8.14.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
11
+ pandas_plots-0.8.14.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- pandas_plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pandas_plots/pls.py,sha256=CUh2lskJ6eLO_ccAg_UXXpRoWvZ7-Q3xKcUSEnKhK9U,23349
3
- pandas_plots/sql.py,sha256=SHrmwhmzq0QYygvaoKwv7neiwf_Rv87VmdUkADYPdR8,2485
4
- pandas_plots/tbl.py,sha256=dH0xKxloxIBBZGz1QfDdAhf8XQc5FclB-OT7fZcqALY,21667
5
- pandas_plots/txt.py,sha256=LnW9OF3mSX2fp9JajefF3Mz3LuCA8MaqlFZYjT_jaQw,1537
6
- pandas_plots/ven.py,sha256=nDKS7cTIHOJhIXKnAxAkEoqPgVZCUPJld5CvSiB2JC4,11721
7
- pandas_plots-0.8.12.dist-info/LICENSE,sha256=6KQ5KVAAhRaB-JJKpX4cefKvRZRgI7GUPc92_2d31XY,1051
8
- pandas_plots-0.8.12.dist-info/METADATA,sha256=e3IstNExB42Hcd_OCkSpnSOtB-loZPDiIZJVasQaEow,5856
9
- pandas_plots-0.8.12.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
10
- pandas_plots-0.8.12.dist-info/top_level.txt,sha256=XnaNuIHBqMmCeh_U7nKOYTwFue_SIA0wxuDgdPmnnSk,13
11
- pandas_plots-0.8.12.dist-info/RECORD,,