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, sql, txt
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 descriptionsdescribe_df()
an alternative version of pandasdescribe()
functionpivot_df()
gets a pivot table of a 3 column dataframe- 🆕
show_num_df()
displays a table as styled version with additional information
-
pls
for plotly visualizationsplot_box()
auto annotated boxplot w/ violin optionplot_boxes()
multiple boxplots (annotation is experimental)plots_bars()
a standardized bar plotplot_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
-
sql
is added as convienience wrapper for retrieving data from sql databasesconnect_sql
get data from['mssql', 'sqlite','postgres']
-
txt
includes some text based utilitieswrap
formats strings or lists to a given width to fit nicely on the screen
note: theming 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 pivoted values for selected columns
tbl.pivot_df(df[['color', 'payment', 'fare']])
# 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,
)
dependencies
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.8.10.tar.gz
.
File metadata
- Download URL: pandas-plots-0.8.10.tar.gz
- Upload date:
- Size: 22.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 | 619080e2ea688a3e56aa047d4c2f965e4b4e328f107f4ec968b11e97f0a81cd2 |
|
MD5 | 0a7ed6987e4b18e73d7a4c315d763ab9 |
|
BLAKE2b-256 | 96c77f1777861a1ca568c4ecf250fd3c44fd9cf6591de6c7f1e9e59f6666bbb8 |
File details
Details for the file pandas_plots-0.8.10-py3-none-any.whl
.
File metadata
- Download URL: pandas_plots-0.8.10-py3-none-any.whl
- Upload date:
- Size: 21.3 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 | c299a879ec8424d90cf9ce2a3b5a747989c21678cb09e6eb4466bdc0ffb82e33 |
|
MD5 | 69e3bb94e1dd131111ab5d362c1bc465 |
|
BLAKE2b-256 | f93312c824cd1a322e481b5e9b3bdd0b3de8447ee4d4b9051d9c6beb4276c3cf |