Imported but unused in python

nag6631 picture nag6631 · Aug 8, 2019 · Viewed 10.9k times · Source
import bumpy as np
import matplotlib.pyplot as per
import pandas as pd.

Console showing some warning. Can anyone help me with this

Answer

Nayantara Jeyaraj picture Nayantara Jeyaraj · Aug 8, 2019

In python, when you import a library, it is expected to be utilized in the code blocks. Hence, as it obviously states, you may have imported these but have not used all of them.

Besides that being the obvious warning, your imports should have been

import numpy as np

NOT bumpy.

And remove the unnecessary period following the pandas import.

import pandas as pd

But if you still want to have imports and not use them, or keep them for later declarations, you could choose to suppress or ignore the warnings, which I do not endorse. But, if you so badly want to get rid of 'em, you can do so by adding the following line to the beginning of your code.

import warnings
warnings.filterwarnings("ignore")