pandas-plots 0.12.0__tar.gz → 0.12.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.
- {pandas_plots-0.12.0/src/pandas_plots.egg-info → pandas_plots-0.12.1}/PKG-INFO +1 -1
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/setup.cfg +1 -1
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots/tbl.py +30 -8
- {pandas_plots-0.12.0 → pandas_plots-0.12.1/src/pandas_plots.egg-info}/PKG-INFO +1 -1
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/LICENSE +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/README.md +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/pyproject.toml +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots/hlp.py +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots/pii.py +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots/pls.py +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots/ven.py +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots.egg-info/SOURCES.txt +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots.egg-info/dependency_links.txt +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots.egg-info/requires.txt +0 -0
- {pandas_plots-0.12.0 → pandas_plots-0.12.1}/src/pandas_plots.egg-info/top_level.txt +0 -0
@@ -699,7 +699,9 @@ def show_num_df(
|
|
699
699
|
|
700
700
|
return out
|
701
701
|
|
702
|
-
|
702
|
+
|
703
|
+
|
704
|
+
def print_summary(df: pd.DataFrame | pd.Series, show: bool = True, name: str="🟠 "):
|
703
705
|
"""
|
704
706
|
Print statistical summary for a pandas DataFrame or Series.
|
705
707
|
|
@@ -712,11 +714,13 @@ def print_summary(df: pd.DataFrame | pd.Series, name: str="🟠 "):
|
|
712
714
|
Args:
|
713
715
|
df (Union[pd.DataFrame, pd.Series]): Input DataFrame or Series. Only numeric columns
|
714
716
|
in DataFrame are considered.
|
717
|
+
show (bool, optional): Whether to print the summary. Defaults to True.
|
718
|
+
name (str, optional): Prefix for the summary. Defaults to "🟠 "
|
715
719
|
"""
|
716
720
|
if df.empty:
|
717
721
|
return
|
718
722
|
|
719
|
-
def print_summary_ser(ser: pd.Series, name: str=""):
|
723
|
+
def print_summary_ser(ser: pd.Series, show: bool=True, name: str=""):
|
720
724
|
# Calculate IQR and pass `rng=(25, 75)` to get the interquartile range
|
721
725
|
iqr_value = stats.iqr(ser)
|
722
726
|
|
@@ -744,14 +748,32 @@ def print_summary(df: pd.DataFrame | pd.Series, name: str="🟠 "):
|
|
744
748
|
upper = max if upper > max else upper
|
745
749
|
|
746
750
|
# * extra care for scipy metrics, these are very vulnarable to nan
|
747
|
-
|
748
|
-
|
751
|
+
if show:
|
752
|
+
print(
|
753
|
+
f"""{name} min: {min:_} | lower: {lower:_} | q25: {q1:_} | median: {med:_} | mean: {mean:_} | q75: {q3:_} | upper: {upper:_} | max: {max:_} | std: {std:_} | cv: {cv:_} | sum: {sum:_} | skew: {skew} | kurto: {kurto}""")
|
754
|
+
|
755
|
+
summary = {
|
756
|
+
"min": min,
|
757
|
+
"lower": lower,
|
758
|
+
"q25": q1,
|
759
|
+
"median": med,
|
760
|
+
"mean": mean,
|
761
|
+
"q75": q3,
|
762
|
+
"upper": upper,
|
763
|
+
"max": max,
|
764
|
+
"std": std,
|
765
|
+
"cv": cv,
|
766
|
+
"sum": sum,
|
767
|
+
"skew": skew,
|
768
|
+
"kurto": kurto
|
769
|
+
}
|
770
|
+
return summary
|
749
771
|
|
750
772
|
if isinstance(df, pd.Series):
|
751
|
-
print_summary_ser(df, name)
|
752
|
-
|
773
|
+
return print_summary_ser(df, show=show, name=name)
|
774
|
+
|
753
775
|
if isinstance(df, pd.DataFrame):
|
754
776
|
# * only show numerics
|
755
777
|
for col in df.select_dtypes("number").columns:
|
756
|
-
print_summary_ser(ser=df[col], name=col)
|
757
|
-
return
|
778
|
+
summary = print_summary_ser(ser=df[col],show=show, name=col)
|
779
|
+
return summary
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|