I'm getting this warning in jupyter notebook.
/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:10: DeprecationWarning: object of type <class 'float'> cannot be safely interpreted as an integer.
# Remove the CWD from sys.path while we load stuff.
/anaconda3/lib/python3.6/site-packages/ipykernel_launcher.py:11: DeprecationWarning: object of type <class 'float'> cannot be safely interpreted as an integer.
# This is added back by InteractiveShellApp.init_path()
It's annoying because it shows up in every run I do:
How do I fix or disable it?
If you are sure your code is correct and simple want to get rid of this warning and all other warnings in the notebook do the following:
import warnings
warnings.filterwarnings('ignore')
Try this:
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
You can also suppress warnings just for some lines of code:
import warnings
def function_that_warns():
warnings.warn("deprecated", DeprecationWarning)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
function_that_warns() # this will not show a warning