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, pls, ven

example

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

pls.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
    • 🆕 show_num_df() displays a table as styled version with additional information
  • pls 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

note: theming can be controlled through all functions by setting the environment variable THEME to either light or dark

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 = {'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,
)

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.7.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

pandas_plots-0.8.7-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file pandas-plots-0.8.7.tar.gz.

File metadata

  • Download URL: pandas-plots-0.8.7.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pandas-plots-0.8.7.tar.gz
Algorithm Hash digest
SHA256 d3ff33a31ee03ec6a1d87627fe10c4983f7170eccd5c01a9f57c5a8c7fec6f05
MD5 a2b8a053992b3f285887beaf4e23556d
BLAKE2b-256 6fb72bbf33301624826a02e453c65bbb6369a0edff0a2d034101dfe62185103a

See more details on using hashes here.

File details

Details for the file pandas_plots-0.8.7-py3-none-any.whl.

File metadata

  • Download URL: pandas_plots-0.8.7-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pandas_plots-0.8.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a4a83487865164d729323a39aab92f3456c7ca8128de92f8bb8278b46f79aa49
MD5 6d5fa0169db85914e6a6e7b3b6aaaf75
BLAKE2b-256 ad3cdfdbb14a73036a0987498c0c7dba492e95b90e5aa83b75de2617117baed0

See more details on using hashes here.

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