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.

Failure with very long series

See original GitHub issue

Since version 1.5.10 the following fails:

asciiplot([1.]*1000, 80, 15)

With the following error:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
pkazmiercommented, Mar 28, 2020

Works again, thanks for the instant turnaround!

1reaction
pkazmiercommented, Mar 28, 2020

This fix has broken asciichartpy for me. Plotting a series of 0 values will now return an empty string instead of a graph with 0 values plotted:

>>> plot([0,0,0,0])
''

By using any, a regular python list of 0 values will evaluate as False.

The simple fix here is to change:

if not any(series) or all(isnan(n) for n in series):

to explicitly check for the length of the series:

if len(series) == 0 or all(isnan(n) for n in series):
Read more comments on GitHub >

github_iconTop Results From Across the Web

10 TV Series That Were Set Up For Failure - Collider
From Firefly to Freaks and Geeks, these shows were on the brink of cancellation for the entire series!
Read more >
Behind all successes are a series of failures | Financial Times
Behind all successes are a series of failures ... Life is a long journey, the world is a big place, and there will...
Read more >
432 startup failure post-mortems - CB Insights
After failing to raise essential capital in a Series A round, the company folded. Humm CEO Iain McIntyre plans to join California-based ...
Read more >
THE SHUTTLE FINDINGS: A LONG SERIES OF FAILURES ...
There was grief and sadness for the loss of seven brave members of the crew; firm national resolve that those men and women...
Read more >
High Risk List | U.S. GAO - Government Accountability Office
The High Risk List is a list of federal programs and operations that are ... has taken high-risk problems seriously and has made...
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