question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Bypass dataframes

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
malmaudcommented, May 16, 2019

Sure, I can just contribute the PR now so we can play with it - I don’t think it will be too hard. No harm if you don’t end up merging it.

0reactions
nicolaskruchtencommented, Sep 11, 2019

This will be implemented as part of plotly/plotly.py#1767 … thanks for the input and patience 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bypassing Pandas Memory Limitations | by Michael Beale
Since the DataFrames (the foundation of Pandas) are kept in memory, there are limits to how much data can be processed at a...
Read more >
Bypassing Pandas Memory Limitations - GeeksforGeeks
Pandas Dataframe can be converted to Sparse Dataframe which means that any data matching a specific value is omitted in the representation. The ......
Read more >
Easy Way to Bypass REST API Query Limits - Ablajan Sulaiman
Easy Way to Bypass REST API Query Limits. Record Extract Limit. Have you ever encountered a limitation of 1000 or 2000 features when...
Read more >
How to use ast.literal_eval in a pandas dataframe and handle ...
I have a dataframe with a column containing a tuple data as a string. ... It would be great even if there is...
Read more >
Feature Request : Functionality to hide empty leaves in tree map
... alice bob chuck david fred 0 alice bob chuck NaN NaN Error : Non-leaves rows are not permitted in the dataframe I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found