Update data.py
Update data.py

- 'mid' index needs to be an int, use floor division.
- _prev_y can't be none in the comparison.

richardingham/octopus,richardingham/octopus,richardingham/octopus,richardingham/octopus