Non Negative Values in Y
See original GitHub issueIs there a reason why if Y has no negative an error is returned.
>>> x = range(2,20)
>>> y=[]
>>> for i in x:
... y.append(i*100)
>>> x
[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
>>> y
[200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900]
>>>
>>> kneed.KneeLocator(x,y)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kneed/knee_locator.py", line 61, in __init__
self.knee, self.norm_knee, self.knee_x = self.find_knee()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kneed/knee_locator.py", line 74, in find_knee
mxmx_iter = np.arange(self.xmx_idx[0], len(self.xsn))
IndexError: index 0 is out of bounds for axis 0 with size 0
>>> y[0]=-1
>>> kneed.KneeLocator(x,y)
<kneed.knee_locator.KneeLocator object at 0x106a56d10>
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Non Negative Function - Statistics How To
A non negative function has function values equal to or greater than zero (i.e., f(x) ≥ 0). The domain (inputs) of the function...
Read more >Why does the graph of y=√x not have a negative value of y ...
y =√x does not have a negative value because it denotes the principal square root of x which is not negative. The negative...
Read more >Better name for "non-negative" value? - Stack Overflow
@Kirk Woll: My best answer to that is "because there's something better". If, in fact, all of these smart people cannot provide something...
Read more >If x and y are nonnegative integers, what is the value of y?
x and y are non-negative integers - This means x & Y can be ZERO and Any POSITIVE integers. y = ? As...
Read more >Nonnegative Value - an overview | ScienceDirect Topics
5.5 Determining Probabilities from a Joint CDF. Suppose that X and Y are given random variables and we are required to determine the...
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 Free
Top 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
Solution Solved. Update from github rather then pip default repo
@raviolli the example you provided didn’t have a local maximum, which caused the error. See the image below, b383b0b includes a print statement informing the user that no maxima was found and returns
None
for the knee so the user can inspect the function.