A collection of helper for table handling and vizualization
Project description
pandas-plots
usage
install / update package
pip install pandas-plots -U
include in python
from pandas_plots import tbl, pls, ven, hlp
example
# load sample dataset from seaborn
import seaborn as sb
df = sb.load_dataset('taxis')
_df = df[["passengers", "distance", "fare"]][:5]
tbl.show_num_df(
_df,
total_axis="xy",
total_mode="mean",
data_bar_axis="xy",
pct_axis="xy",
precision=0,
kpi_mode="max_min_x",
kpi_rag_list=(1,7),
)
why use pandas-plots
pandas-plots
is a package to help you examine and visualize data that are organized in a pandas DataFrame. It provides a high level api to pandas / plotly with some selected functions.
It is subdivided into:
-
tbl
utilities for table descriptions- 🌟
show_num_df()
displays a table as styled version with additional information describe_df()
an alternative version of pandasdescribe()
functionpivot_df()
gets a pivot table of a 3 column dataframe- ⚠️
pivot_df()
is depricated and wont get further updates. Its features are well covered in standardpd.pivot_table()
- ⚠️
- 🌟
-
pls
for plotly visualizationsplot_box()
auto annotated boxplot w/ violin optionplot_boxes()
multiple boxplots (annotation is experimental)plots_bars()
a standardized bar plot- 🆕 now features convidence intervals via
use_ci
option
- 🆕 now features convidence intervals via
plot_stacked_bars()
shortcut to stacked bars 😄plot_quadrants()
quickly shows a 2x2 heatmap
-
ven
offers functions for venn diagramsshow_venn2()
displays a venn diagram for 2 setsshow_venn3()
displays a venn diagram for 3 sets
-
hlp
contains some (variety) helper functionsdf_to_series()
converts a dataframe to a seriesmean_confidence_interval()
calculates mean and confidence interval for a serieswrap_text()
formats strings or lists to a given width to fit nicely on the screenreplace_delimiter_outside_quotes()
when manual import of csv files is needed: replaces delimiters only outside of quotes
note: theme setting can be controlled through all functions by setting the environment variable
THEME
to either light or dark
more examples
pls.plot_box(df['fare'], height=400, violin=True)
# quick and exhaustive description of any table
tbl.describe_df(df, 'taxis', top_n_uniques=5)
# show bars with confidence intervals
_df = df[["payment", "fare"]]
pls.plot_bars(
_df,
dropna=False,
use_ci=True,
height=600,
width=800,
precision=1,
)
# show venn diagram for 3 sets
from pandas_plots import ven
set_a = {'ford','ferrari','mercedes', 'bmw'}
set_b = {'opel','bmw','bentley','audi'}
set_c = {'ferrari','bmw','chrysler','renault','peugeot','fiat'}
_df, _details = ven.show_venn3(
title="taxis",
a_set=set_a,
a_label="cars1",
b_set=set_b,
b_label="cars2",
c_set=set_c,
c_label="cars3",
verbose=0,
size=8,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pandas-plots-0.9.8.tar.gz
.
File metadata
- Download URL: pandas-plots-0.9.8.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cf2e8fcd4a96423497dacc57749de99364a8353aa902f3c63a55b629d626b4d |
|
MD5 | 9c421f913c3079838b3719bd050ffdd7 |
|
BLAKE2b-256 | 0e2344742dfe0b7affab4998221f52ccdecc16acab2569e36a7a7025dffc756c |
File details
Details for the file pandas_plots-0.9.8-py3-none-any.whl
.
File metadata
- Download URL: pandas_plots-0.9.8-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14ca50f0386b2f069400b3ee01d049528051bf9424fe4422a91a292f17b52d39 |
|
MD5 | bb9364c1efd6c5aca4c0ad3d840c0ceb |
|
BLAKE2b-256 | f4a983fafb9b9864141b0e340bca74896222622fcd720cf56f7322a9f94bf72c |