Skip to main content

Enhance pandas DataFrame with direct Plotly Express plotting functions

Project description

plotlyplus

Introduction

plotlyplus is a Python module that simplify the calling of plotly.express function. In standard way, one needs to do the following to create a plot using plotly.express based on a dataframe, df, you need to do the following

import pandas as pd
import plotly.express as px

px.scatter(df, x='namex',y='namey')

The plotlyplus package add the plotly.express plotting methods to the pandas dataframe class. This will simply the call to the plotting function as:

from plotlyplus.plotlyplus import *

df.scatter(x='namex',y='namey')

This is a small and almost trivial tweak, but brings a lot of convenience in daily practical work. Enjoy!

Key Features

  • Better integration of plotly.express functions to pandas dataframe: Directly integrates Plotly Express plotting functions with pandas DataFrames.
  • Safe mode: To avoid naming conflicts, plotlyplus introduces a 'safe mode' (plotlyplus_safe). In this mode, each plotly.express function is prefixed with `px_``, ensuring namespace integrity at the cost of slightly reduced convenience.

Installation

Install PlotlyPlus using pip with the following command:

pip install plotlyplus

Usage

Standard Mode

All plotly.express fundtions become methods of pandas dataframe.

from plotlyplus.plotlyplus import *

df = pd.DataFrame(...)
fig = df.bar(...)  # Plotly Express function as a DataFrame method
fig.show()

Safe Mode

This mode prefixes the Plotly Express functions with px_ to minimize namespace conflicts.

from plotlyplus.plotlyplus_safe import *

df = pd.DataFrame(...)
fig = df.px_bar(...)  # Plotly Express function as a DataFrame method
fig.show()

Contributing

Contributions to PlotlyPlus are welcome. Please feel free to submit pull requests, report bugs, or suggest features.

License

PlotlyPlus is made available under the MIT License.

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

plotlyplus-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotlyplus-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file plotlyplus-0.1.1.tar.gz.

File metadata

  • Download URL: plotlyplus-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for plotlyplus-0.1.1.tar.gz
Algorithm Hash digest
SHA256 662872595f3b7593c4f91e8f48e26f76ca21db7cf079cc8c91c3fe558a974c43
MD5 58ac15d48bb91b55a7818acff50916a1
BLAKE2b-256 af0579ea2d5b049d38a0eef9cb996d2ee1cc52f4ccdb39744ff384b6375f61f1

See more details on using hashes here.

File details

Details for the file plotlyplus-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: plotlyplus-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for plotlyplus-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0af70a896119436de46891be8b893c1c68aa75a6e204754229449959a39cc0cd
MD5 776b66029e62f0177b5556d9b4890a83
BLAKE2b-256 4d88b21842699c9d92f4a900797c32f5bf6d8e2d050cd3849492bbabfc88d83b

See more details on using hashes here.

Supported by

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