pandas-plots 0.15.3__tar.gz → 0.15.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.
Files changed (22) hide show
  1. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/PKG-INFO +1 -1
  2. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/pyproject.toml +1 -1
  3. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/pandas_plots/pls.py +9 -4
  4. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/test.ipynb +500 -500
  5. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/.gitignore +0 -0
  6. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/.python-version +0 -0
  7. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/LICENSE +0 -0
  8. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/README.md +0 -0
  9. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/img/2024-02-13-00-40-27.png +0 -0
  10. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/img/2024-02-14-20-49-00.png +0 -0
  11. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/img/2024-02-19-20-49-52.png +0 -0
  12. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/img/2024-03-02-17-33-43.png +0 -0
  13. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/img/2024-03-24-09-59-32.png +0 -0
  14. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/assets/Rplots.pdf +0 -0
  15. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/assets/dsich.csv +0 -0
  16. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/assets/facets.csv +0 -0
  17. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/pandas_plots/__init__.py +0 -0
  18. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/pandas_plots/hlp.py +0 -0
  19. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/pandas_plots/tbl.py +0 -0
  20. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/pandas_plots/ven.py +0 -0
  21. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/src/test.r +0 -0
  22. {pandas_plots-0.15.3 → pandas_plots-0.15.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pandas-plots
3
- Version: 0.15.3
3
+ Version: 0.15.4
4
4
  Summary: A collection of helper for table handling and visualization
5
5
  Project-URL: Homepage, https://github.com/smeisegeier/pandas-plots
6
6
  Project-URL: Repository, https://github.com/smeisegeier/pandas-plots
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pandas-plots"
3
- version = "0.15.3"
3
+ version = "0.15.4"
4
4
  description = "A collection of helper for table handling and visualization"
5
5
  long_description = "file: README.md"
6
6
  long_description_content_type = "text/markdown"
@@ -375,19 +375,24 @@ def plot_stacked_bars(
375
375
  caption = _set_caption(caption)
376
376
 
377
377
  # * after grouping add cols for pct and formatting
378
- df["cnt_pct_all_only"] = df["value"].apply(lambda x: f"{(x / n) * 100:.{precision}f}%")
379
- df["cnt_pct_bar_only"] = (df["value"] / bar_totals * 100).apply(lambda x: f"{x:.{precision}f}%")
378
+ df["cnt_pct_all_only"] = (df["value"] / n * 100).apply(lambda x: f"{(x):.{precision}f}%")
379
+ df["cnt_pct_bar_only"] = (df["value"] / bar_totals * 100).apply(lambda x: f"{(x):.{precision}f}%")
380
380
 
381
381
  # * format output
382
382
  df["cnt_str"] = df["value"].apply(lambda x: f"{x:_.{precision}f}")
383
383
 
384
384
  divider2 = "<br>" if orientation == "v" else " "
385
385
 
386
+ # Modify this section
386
387
  df["cnt_pct_all_str"] = df.apply(
387
- lambda row: f"{row['cnt_str']}{divider2}({row['cnt_pct_all_only']})", axis=1
388
+ lambda row: f"{row['cnt_str']}{divider2}({row['cnt_pct_all_only']})"
389
+ if (row["value"] / n * 100) >= 5 else row["cnt_str"],
390
+ axis=1
388
391
  )
389
392
  df["cnt_pct_bar_str"] = df.apply(
390
- lambda row: f"{row['cnt_str']}{divider2}({row['cnt_pct_bar_only']})", axis=1
393
+ lambda row: f"{row['cnt_str']}{divider2}({row['cnt_pct_bar_only']})"
394
+ if (row["value"] / bar_totals.loc[row.name] * 100) >= 5 else row["cnt_str"],
395
+ axis=1
391
396
  )
392
397
 
393
398
  text_to_show = "cnt_str"