pandas-plots 0.10.0__tar.gz → 0.10.1__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.10.0
3
+ Version: 0.10.1
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
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = pandas-plots
3
- version = 0.10.0
3
+ version = 0.10.1
4
4
  author = smeisegeier
5
5
  author_email = dexterDSDo@googlemail.com
6
6
  description = A collection of helper for table handling and vizualization
@@ -571,7 +571,7 @@ def plot_bars(
571
571
 
572
572
 
573
573
  def plot_histogram(
574
- df: pd.DataFrame,
574
+ df_ser: pd.DataFrame | pd.Series,
575
575
  histnorm: Literal[
576
576
  "probability", "probability density", "density", "percent", None
577
577
  ] = None,
@@ -587,10 +587,13 @@ def plot_histogram(
587
587
  title: str = None,
588
588
  ) -> None:
589
589
  """
590
- A function to plot a histogram based on a numeric columns in a DataFrame.
590
+ A function to plot a histogram based on *numeric* columns in a DataFrame.
591
+ Accepts:
592
+ - a numeric series
593
+ - a dataframe with only numeric columns
591
594
 
592
595
  Parameters:
593
- df (pd.DataFrame): The DataFrame containing the data to be plotted.
596
+ df_ser (pd.DataFrame | pd.Series): The input containing the data to be plotted.
594
597
  histnorm (Literal["probability", "probability density", "density", "percent", None]): The normalization mode for the histogram. Default is None.
595
598
  nbins (int): The number of bins in the histogram. Default is 0.
596
599
  orientation (Literal["h", "v"]): The orientation of the histogram. Default is "v".
@@ -606,6 +609,12 @@ def plot_histogram(
606
609
  Returns:
607
610
  None
608
611
  """
612
+
613
+ # * convert to df if series
614
+ if isinstance(df_ser, pd.Series):
615
+ df = df_ser.to_frame()
616
+ else:
617
+ df=df_ser
609
618
 
610
619
  col_not_num = df.select_dtypes(exclude="number").columns
611
620
  if any(col_not_num):
@@ -660,7 +669,7 @@ def plot_joint(
660
669
  title: str = "",
661
670
  ) -> None:
662
671
  """
663
- Generate a seaborn joint plot for two *numeric* columns of a given DataFrame.
672
+ Generate a seaborn joint plot for *two numeric* columns of a given DataFrame.
664
673
 
665
674
  Parameters:
666
675
  - df: The DataFrame containing the data to be plotted.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pandas-plots
3
- Version: 0.10.0
3
+ Version: 0.10.1
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
File without changes
File without changes