pandas-plots


Namepandas-plots JSON
Version 0.12.30 PyPI version JSON
download
home_pagehttps://github.com/smeisegeier/pandas-plots
SummaryA collection of helper for table handling and visualization
upload_time2025-07-14 10:00:31
maintainerNone
docs_urlNone
authorsmeisegeier
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pandas-plots

![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10_|_3.11_|_3.12-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)

## usage

install / update package

```bash
pip install pandas-plots -U
```

include in python

```python
from pandas_plots import tbl, pls, ven, hlp
```

## example

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

```python
_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),
)
```

![show_num](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-03-02-17-33-43.png?raw=true)

## 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 and predefined options:

- `tbl` utilities for table descriptions
  - 🌟`show_num_df()` displays a table as styled version with additional information
  - `describe_df()` an alternative version of pandas `describe()` function
  - `descr_db()` a very short descr for a `duckdb` relation
  - `pivot_df()` gets a pivot table of a 3 column dataframe (or 2 columns if no weights are given)
  - `print_summary()` shows statistics for a pandas DataFrame or Series
<br>

- `pls` for plotly visualizations
  - `plot_box()` auto annotated boxplot w/ violin option
  - `plot_boxes()` multiple boxplots _(annotation is experimental)_
  - `plot_stacked_bars()` shortcut to stacked bars 😄
  - `plots_bars()` a standardized bar plot for a **categorical** column
    - features confidence intervals via `use_ci` option
  - `plot_histogram()` histogram for one or more **numerical** columns
  - `plot_joints()` a joint plot for **exactly two numerical** columns
  - `plot_quadrants()` quickly shows a 2x2 heatmap
  - `plot_facet_stacked_bars()` shows stacked bars for a facet value as subplots 
<br>

- `ven` offers functions for _venn diagrams_
  - `show_venn2()` displays a venn diagram for 2 sets
  - `show_venn3()` displays a venn diagram for 3 sets
<br>

- `hlp` contains some (variety) helper functions
  - `to_series()` converts a dataframe to a series (`🚨 breaking change`)
  - `mean_confidence_interval()` calculates mean and confidence interval for a series
  - `wrap_text()` formats strings or lists to a given width to fit nicely on the screen
  - `replace_delimiter_outside_quotes()` when manual import of csv files is needed: replaces delimiters only outside of quotes
  - `create_barcode_from_url()` creates a barcode from a given URL
  - `add_datetime_col()` adds a datetime columns to a dataframe (chainable)
  - `show_package_version` prints version of a list of packages
  - `get_os` helps to identify and ensure operating system at runtime
  - `add_bitmask_label()` adds a column to the data that resolves a bitmask column into human-readable labels
  - `find_cols()` finds all columns in a list of columns that contain any of the given stubs
  - `add_measures_to_pyg_config()` adds measures to a pygwalker config file to avoid frequent manual update
<br>

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

## more examples

```python
pls.plot_box(df['fare'], height=400, violin=True)
```

![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)

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

![describe_df](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-14-20-49-00.png?raw=true)

```python
# show bars with confidence intervals
_df = df[["payment", "fare"]]
pls.plot_bars(
    _df,
    dropna=False,
    use_ci=True,
    height=600,
    width=800,
    precision=1,
)
```

![bars_with_ci](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-03-24-09-59-32.png?raw=true)

```python
# 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](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-19-20-49-52.png?raw=true)

## tags

#pandas, #plotly, #visualizations, #statistics

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/smeisegeier/pandas-plots",
    "name": "pandas-plots",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "smeisegeier",
    "author_email": "dexterDSDo@googlemail.com",
    "download_url": "https://files.pythonhosted.org/packages/46/39/51b8c8a4bcbfeeff3b64742d84945484d98d1d4df5226602f152deaed1f8/pandas_plots-0.12.30.tar.gz",
    "platform": null,
    "description": "# pandas-plots\n\n![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10_|_3.11_|_3.12-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI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from pandas_plots import tbl, pls, ven, hlp\n```\n\n## example\n\n```python\n# load sample dataset from seaborn\nimport seaborn as sb\ndf = sb.load_dataset('taxis')\n```\n\n```python\n_df = df[[\"passengers\", \"distance\", \"fare\"]][:5]\ntbl.show_num_df(\n    _df,\n    total_axis=\"xy\",\n    total_mode=\"mean\",\n    data_bar_axis=\"xy\",\n    pct_axis=\"xy\",\n    precision=0,\n    kpi_mode=\"max_min_x\",\n    kpi_rag_list=(1,7),\n)\n```\n\n![show_num](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-03-02-17-33-43.png?raw=true)\n\n## why use pandas-plots\n\n`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 and predefined options:\n\n- `tbl` utilities for table descriptions\n  - \ud83c\udf1f`show_num_df()` displays a table as styled version with additional information\n  - `describe_df()` an alternative version of pandas `describe()` function\n  - `descr_db()` a very short descr for a `duckdb` relation\n  - `pivot_df()` gets a pivot table of a 3 column dataframe (or 2 columns if no weights are given)\n  - `print_summary()` shows statistics for a pandas DataFrame or Series\n<br>\n\n- `pls` for plotly visualizations\n  - `plot_box()` auto annotated boxplot w/ violin option\n  - `plot_boxes()` multiple boxplots _(annotation is experimental)_\n  - `plot_stacked_bars()` shortcut to stacked bars \ud83d\ude04\n  - `plots_bars()` a standardized bar plot for a **categorical** column\n    - features confidence intervals via `use_ci` option\n  - `plot_histogram()` histogram for one or more **numerical** columns\n  - `plot_joints()` a joint plot for **exactly two numerical** columns\n  - `plot_quadrants()` quickly shows a 2x2 heatmap\n  - `plot_facet_stacked_bars()` shows stacked bars for a facet value as subplots \n<br>\n\n- `ven` offers functions for _venn diagrams_\n  - `show_venn2()` displays a venn diagram for 2 sets\n  - `show_venn3()` displays a venn diagram for 3 sets\n<br>\n\n- `hlp` contains some (variety) helper functions\n  - `to_series()` converts a dataframe to a series (`\ud83d\udea8 breaking change`)\n  - `mean_confidence_interval()` calculates mean and confidence interval for a series\n  - `wrap_text()` formats strings or lists to a given width to fit nicely on the screen\n  - `replace_delimiter_outside_quotes()` when manual import of csv files is needed: replaces delimiters only outside of quotes\n  - `create_barcode_from_url()` creates a barcode from a given URL\n  - `add_datetime_col()` adds a datetime columns to a dataframe (chainable)\n  - `show_package_version` prints version of a list of packages\n  - `get_os` helps to identify and ensure operating system at runtime\n  - `add_bitmask_label()` adds a column to the data that resolves a bitmask column into human-readable labels\n  - `find_cols()` finds all columns in a list of columns that contain any of the given stubs\n  - `add_measures_to_pyg_config()` adds measures to a pygwalker config file to avoid frequent manual update\n<br>\n\n> note: theme setting can be controlled through all functions by setting the environment variable `THEME` to either light or dark\n\n## more examples\n\n```python\npls.plot_box(df['fare'], height=400, violin=True)\n```\n\n![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)\n\n```python\n# quick and exhaustive description of any table\ntbl.describe_df(df, 'taxis', top_n_uniques=5)\n```\n\n![describe_df](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-14-20-49-00.png?raw=true)\n\n```python\n# show bars with confidence intervals\n_df = df[[\"payment\", \"fare\"]]\npls.plot_bars(\n    _df,\n    dropna=False,\n    use_ci=True,\n    height=600,\n    width=800,\n    precision=1,\n)\n```\n\n![bars_with_ci](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-03-24-09-59-32.png?raw=true)\n\n```python\n# show venn diagram for 3 sets\nfrom pandas_plots import ven\n\nset_a = {'ford','ferrari','mercedes', 'bmw'}\nset_b = {'opel','bmw','bentley','audi'}\nset_c = {'ferrari','bmw','chrysler','renault','peugeot','fiat'}\n_df, _details = ven.show_venn3(\n    title=\"taxis\",\n    a_set=set_a,\n    a_label=\"cars1\",\n    b_set=set_b,\n    b_label=\"cars2\",\n    c_set=set_c,\n    c_label=\"cars3\",\n    verbose=0,\n    size=8,\n)\n```\n\n![venn](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-19-20-49-52.png?raw=true)\n\n## tags\n\n#pandas, #plotly, #visualizations, #statistics\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A collection of helper for table handling and visualization",
    "version": "0.12.30",
    "project_urls": {
        "Bug Tracker": "https://github.com/smeisegeier/pandas-plots/issues",
        "Documentation": "https://github.com/smeisegeier/pandas-plots",
        "Homepage": "https://github.com/smeisegeier/pandas-plots",
        "Source Code": "https://github.com/smeisegeier/pandas-plots"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4fa2676345505d7608379b0b4887c0c07adc2c818608ff10fc4036438d84a21d",
                "md5": "5b2b76bd588870f862521d01b8c75bba",
                "sha256": "e3ce809df16316ea17a17b0e07f906e7705ab9262bb68dbb3f3d447eacbaf43e"
            },
            "downloads": -1,
            "filename": "pandas_plots-0.12.30-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5b2b76bd588870f862521d01b8c75bba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 37015,
            "upload_time": "2025-07-14T10:00:29",
            "upload_time_iso_8601": "2025-07-14T10:00:29.847057Z",
            "url": "https://files.pythonhosted.org/packages/4f/a2/676345505d7608379b0b4887c0c07adc2c818608ff10fc4036438d84a21d/pandas_plots-0.12.30-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "463951b8c8a4bcbfeeff3b64742d84945484d98d1d4df5226602f152deaed1f8",
                "md5": "b09065fefb6a3e3aa1378323c2424972",
                "sha256": "630d9c4d53d1b140152358fb0708d89c6d6fa0d616d0fbf15cac4481b57d0e65"
            },
            "downloads": -1,
            "filename": "pandas_plots-0.12.30.tar.gz",
            "has_sig": false,
            "md5_digest": "b09065fefb6a3e3aa1378323c2424972",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 38724,
            "upload_time": "2025-07-14T10:00:31",
            "upload_time_iso_8601": "2025-07-14T10:00:31.013074Z",
            "url": "https://files.pythonhosted.org/packages/46/39/51b8c8a4bcbfeeff3b64742d84945484d98d1d4df5226602f152deaed1f8/pandas_plots-0.12.30.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 10:00:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "smeisegeier",
    "github_project": "pandas-plots",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pandas-plots"
}
        
Elapsed time: 1.44596s