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.

Plotly express should check if input data is tidy

See original GitHub issue

Currently, it’s easy to run into internal errors like follows:

 --> 277  hover_lines = [k + "=" + v for k, v in mapping_labels.items()]
     278  result["hovertemplate"] = hover_header + "<br>".join(hover_lines)
     279  return result, fit_results

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Whereas it would be good to check that the input dataframe is fine before charting, and issue a pinpointed error message rather than fail internally following the dirty python tradition.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolaskruchtencommented, Sep 19, 2019

Fair enough.

In any case, we are working on more flexible input types, although the “tidy” philosophy will remain, i.e. you’ll still need to concatenate your vectors to do this sort of thing: https://stackoverflow.com/questions/57988604, you just won’t be required to stick them into a data frame first 😃

1reaction
matanstercommented, Sep 19, 2019

Thanks for your positive attitude! it seems that in defiance of python tradition, an input-safe library would be even more awesome than what plotly/express already is, especially given that charts need to be developed ad-hoc very typically, by people who don’t recall every caveat or limitation of the API at the moments when they come to create, iterate, and choose between visualizations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plotly express arguments in Python
Plotly Express works with Long-, Wide-, and Mixed-Form Data​​ Until version 4.8, Plotly Express only operated on long-form (previously called "tidy") data, but ......
Read more >
Beyond “tidy”: Plotly Express now accepts wide-form and ...
This ability to map data dimensions to visual variables, no matter the form, is what allows Plotly Express to operate not only on...
Read more >
Visualization with Plotly.Express: Comprehensive guide
A detailed guide on how to create many visualizations with Plotly Express with layout styling, interactivity, animations, and many chart ...
Read more >
combine formula and tidy eval (plotly) - Stack Overflow
The plotly R package was created a little before rlang , and has its own non-standard evaluation (NSE) system, that as far as...
Read more >
How to Create a Plotly Scatter Plot - Sharp Sight
The data_frame parameter allows you to specify the Pandas DataFrame that contains the data that you want to plot. ... Your DataFrame should...
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