Recibo esta advertencia en el cuaderno jupyter.
/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()Es molesto porque aparece en cada carrera que hago:
¿Cómo lo soluciono o deshabilito?
Si está seguro de que su código es correcto y simple, desea deshacerse de esta advertencia y todas las demás advertencias en el cuaderno , haga lo siguiente:
import warnings warnings.filterwarnings('ignore')Prueba esto:
import warnings warnings.filterwarnings('ignore') warnings.simplefilter('ignore')También puede suprimir las advertencias solo para algunas líneas de código:
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