Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Feature request: Bypass dataframes #85

Closed
@malmaud

Description

@malmaud

Thanks for this fantastic package!

I'm wondering if in the spirit of this package being useful for creating exploratory graphs with minimum boilerplate, it makes sense to be able to pass in arrays in lieu of dataframe column names for the plotting function fields.

eg, let

px.scatter(x=[1,2],y=[3,4])

be equivalent to

df=pandas.DataFrame({'x': [1,2], 'y': [3,4]})
px.scatter(df, x='x', y='y')

With the current Plotly API, I think the simplest alternative is

from plotly import graph_objs as go
plot([go.Scatter(x=[1,2],y=[3,4])])

which feels verbose compared to the px alternative mentioned above and which would require a complete refactor if I decide my data has become rich enough that I want to start using a dataframe-based representation.

As it stands, the necessity of constructing a dataframe can actually make plotly express more vebose than using plotly directly. It would be great for px to be the one-shop-stop package for exploratory plotting in Python.

Seaborn, which is stated as an inspiration for this package, does support this syntax for the majority of its plotting functions.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions