. Advertisement .
..3..
. Advertisement .
..4..
As advised, I used some code samples in another forum, but it could not improve the problem. My question is the “valueerror: zero-size array to reduction operation maximum which has no identity” in python. How to solve it? The command line is:
ax.set_ylim([y.min()-0.05, y.max()+0.05])
and the result:
ValueError: zero-size array to reduction operation minimum which has no identity
What does the message mean? Can you advise me to fix it? If you have other better answers, leave them in the answer box below.
The cause: The data is noisy and occasionally has gaps, which is the cause. It therefore occurs that some ranges are plotted without any data. Using the
.min()
function in that situation usually results in the “valueerror: zero-size array to reduction operation maximum which has no identity”.Solution: To solve the problem, simply catch the exception and disregard it: