pandas-plots 0.12.2__tar.gz → 0.12.4__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.2/src/pandas_plots.egg-info → pandas_plots-0.12.4}/PKG-INFO +1 -1
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/setup.cfg +1 -1
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots/pls.py +38 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots/tbl.py +1 -10
- {pandas_plots-0.12.2 → pandas_plots-0.12.4/src/pandas_plots.egg-info}/PKG-INFO +1 -1
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/LICENSE +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/README.md +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/pyproject.toml +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots/hlp.py +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots/pii.py +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots/ven.py +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots.egg-info/SOURCES.txt +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots.egg-info/dependency_links.txt +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots.egg-info/requires.txt +0 -0
- {pandas_plots-0.12.2 → pandas_plots-0.12.4}/src/pandas_plots.egg-info/top_level.txt +0 -0
@@ -278,6 +278,44 @@ def plot_stacked_bars(
|
|
278
278
|
height=height,
|
279
279
|
color_discrete_map=column_colors, # Use assigned colors
|
280
280
|
)
|
281
|
+
# * get longest bar
|
282
|
+
bar_max = (
|
283
|
+
df.groupby(col_index)[df.columns[2]].sum().sort_values(ascending=False).iloc[0]
|
284
|
+
* BAR_LENGTH_MULTIPLIER
|
285
|
+
)
|
286
|
+
# * ignore if bar mode is on
|
287
|
+
if not relative:
|
288
|
+
if orientation == "v":
|
289
|
+
_fig.update_yaxes(range=[0, bar_max])
|
290
|
+
else:
|
291
|
+
_fig.update_xaxes(range=[0, bar_max])
|
292
|
+
else:
|
293
|
+
_fig.update_layout(barnorm="percent")
|
294
|
+
|
295
|
+
# * set title properties
|
296
|
+
_fig.update_layout(
|
297
|
+
title={
|
298
|
+
# 'x': 0.1,
|
299
|
+
"y": 0.95,
|
300
|
+
"xanchor": "left",
|
301
|
+
"yanchor": "top",
|
302
|
+
"font": {
|
303
|
+
"size": 24,
|
304
|
+
},
|
305
|
+
},
|
306
|
+
)
|
307
|
+
|
308
|
+
# * set dtick
|
309
|
+
if orientation == "h":
|
310
|
+
if relative:
|
311
|
+
_fig.update_xaxes(dtick=5)
|
312
|
+
elif normalize:
|
313
|
+
_fig.update_xaxes(dtick=0.05)
|
314
|
+
else:
|
315
|
+
if relative:
|
316
|
+
_fig.update_yaxes(dtick=5)
|
317
|
+
elif normalize:
|
318
|
+
_fig.update_yaxes(dtick=0.05)
|
281
319
|
|
282
320
|
# * show grids, set to smaller distance on pct scale
|
283
321
|
_fig.update_xaxes(showgrid=True, gridwidth=1)
|
@@ -162,12 +162,7 @@ def describe_df(
|
|
162
162
|
# * only show numerics
|
163
163
|
for col in df.select_dtypes("number").columns:
|
164
164
|
_u, _h = get_uniques_header(col)
|
165
|
-
|
166
|
-
# * extra care for scipy metrics, these are very vulnarable to nan
|
167
|
-
# print(
|
168
|
-
# f"{_h} min: {round(df[col].min(),3):_} | max: {round(df[col].max(),3):_} | median: {round(df[col].median(),3):_} | mean: {round(df[col].mean(),3):_} | std: {round(df[col].std(),3):_} | cv: {round(df[col].std() / df[col].mean(),3):_} | sum: {round(df[col].sum(),3):_} | skew: {round(stats.skew(df[col].dropna().tolist()),3)} | kurto: {round(stats.kurtosis(df[col].dropna().tolist()),3)}"
|
169
|
-
# )
|
170
|
-
print_summary(df[col], _h)
|
165
|
+
print_summary(df=df[col], name=_h)
|
171
166
|
|
172
167
|
# * show first 3 rows
|
173
168
|
display(df[:3])
|
@@ -782,8 +777,4 @@ def print_summary(df: pd.DataFrame | pd.Series, show: bool = True, name: str="
|
|
782
777
|
for col in df.select_dtypes("number").columns:
|
783
778
|
summary = print_summary_ser(ser=df[col],show=show, name=col)
|
784
779
|
|
785
|
-
# enable chaining
|
786
|
-
pd.DataFrame.print_summary = print_summary
|
787
|
-
pd.Series.print_summary = print_summary
|
788
|
-
|
789
780
|
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
|