Skip to main content

A collection of helper for table handling and vizualization

Project description

pandas-plots

PyPI - Version GitHub last commit GitHub License py3.10

usage

install / update package

pip install pandas-plots -U

include in python

from pandas_plots import tbl, plt, ven

example

# load sample dataset from seaborn
import seaborn as sb
df = sb.load_dataset('taxis')

plt.plot_box(df['fare'], height=400, violin=True)

plot_box

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

    • describe_df() an alternative version of pandas describe() function
    • pivot_df() gets a pivot table of a 3 column dataframe
  • plt for plotly visualizations

    • plot_box() auto annotated boxplot w/ violin option
    • plot_boxes() multiple boxplots (annotation is experimental)
    • plots_bars() a standardized bar plot
    • plot_stacked_bars() shortcut to stacked bars 😄
    • plot_quadrants() quickly shows a 2x2 heatmap
  • ven offers functions for venn diagrams

    • show_venn2() displays a venn diagram for 2 sets
    • show_venn3() displays a venn diagram for 3 sets
  • sql is added as convienience wrapper for retrieving data from sql databases

    • connect_sql get data from ['mssql', 'sqlite','postgres']
  • txt includes some text based utilities

    • wrap formats strings or lists to a given width to fit nicely on the screen

more examples

# quick and exhaustive description of any table
tbl.describe_df(df, 'taxis', top_n_uniques=5)

describe_df

# show pivoted values for selected columns
tbl.pivot_df(df[['color', 'payment', 'fare']])

pivot_df

# show venn diagram for 3 sets
from pandas_plots import ven

set_a = set(df.pickup_zone)
set_b = set(df.dropoff_zone)
set_c = set(df['pickup_borough'])
_df, _details = ven.show_venn3(
    "taxis",
    set_a,
    "pick",
    set_b,
    "drop",
    c_set=set_c,
    c_label="borough",
    verbose=0,
    size=8,
)

venn

dependencies

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-plots-0.8.1.tar.gz (19.8 kB view hashes)

Uploaded Source

Built Distribution

pandas_plots-0.8.1-py3-none-any.whl (19.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page