When executing the tutorial, we sometimes run into this issue
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-1-77114f63db44> in <module>
9 j = i
10 start = index[i]
---> 11 while error[i] > thresh:
12 i += 1
13
IndexError: index 10321 is out of bounds for axis 0 with size 10321
IndexError: index 10321 is out of bounds for axis 0 with size 10321
Fix proposal
Change error calculation code to not exceed the size of the array
# threshold thresh = 10 intervals = list() i = 0 max_start = len(error) while i < max_start: j = i start = index[i] while i < len(error) and error[i] > thresh: i += 1 end = index[i] if start != end: intervals.append((start, end, np.mean(error[j: i+1]))) i += 1
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4