# How do I handle division by 0 in Kaggle?

I have written a RNN algorithm in Python/IDLE and ran it. It works and is successful. My dataset is large so I wanted to run it using Kaggle's computers, rather than my laptop. However, when I copied and pasted the code, the Kaggle console reported that there had been a division by 0. I'm guessing that IDLE has a built in method of handling division by 0's whereas Kaggle doesn't, hence why it was never reported in the IDLE console, and had been reported in the Kaggle console. How can I overcome this?

• My first advice would be to debug and check that it's exactly the same process which is run. Check in particular that the data is correctly loaded: if a file is not found and silently ignored it could cause an empty dataset, hence a dvide by zero somewhere. – Erwan Aug 7 '19 at 16:29
• Also make sure you're running the same version of Python and your libraries. If, for example you're using python2 in kaggle it's possible that the integer division caused something small to go to 0. Then if you divide by this you could get the error. Try adding from __future__ import division to see if it fixes it. Same thing may be caused by older versions of your libraries. – Djib2011 Aug 8 '19 at 9:38