Better error message when using sum() with plots
See original GitHub issueI think it’d be nice to make holoviews work with Python sum()
.
sum([holoviews.Area(data=(x[num], y[num])) for num in range(8)]).cols(2)
This is currently raising an exception, since sum([area1, area2, area3, ...])
is equivalent to 0 + area1 + area2 + area3
(the 0
is the start
in sum(iterable, /, start=0)
). And Area
(or other elements) __radd__
is not implemented for 0
.
Feels like using sum()
would make cases like the above much more readable than alternatives using functools.reduce
or loops. I think it’d be worth implementing it, even if Area() + 0
may not make so much sense per se.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Getting an error while plotting sum and average in pandas
Calling the groupby() method of a DataFrame yields a groupby object upon which you then need to call an aggregation function, like sum...
Read more >Plotting means and error bars (ggplot2) - Cookbook for R
First, it is necessary to summarize the data. This can be done in a number of ways, as described on this page. In...
Read more >Refactor validation rule show error message if sum of number ...
It should show and error message if the sum of a number of fields must equal the value in another field when saving...
Read more >Interpreting Residual Plots to Improve Your Regression
When you run a regression, Stats iQ automatically calculates and plots residuals to help you understand and improve your regression model.
Read more >8 Excel Error Messages You're Sick of Seeing (And How to Fix ...
Best Practices That'll Help You Reduce Excel Errors ... #VALUE! Excel error message shown vertically down the Sum column of a spreadsheet ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’ve got pretty amazing error messages suggesting the right thing to do for some mistakes (like a misspelled
opt
). Not sure how many users would think ofsum
, but maybe raising an error message suggesting to useLayout
when_radd_
is called for0
could be useful. Something like:Addressed in the PR referenced above.