Hermes Morales
Hermes Morales

Reputation: 637

Not importing pandas from a function

The error is shown in the image.

Jupyter notebook not importing pandas from function

It is shown that the cells have been executed consecutively. Where is the error?

If I call pandas directly it functions ok.

Upvotes: 0

Views: 149

Answers (2)

Alp Sarıca
Alp Sarıca

Reputation: 76

I think pandas is imported only on the scope of function.

Upvotes: 6

Utpal Kumar
Utpal Kumar

Reputation: 300

You imported pandas in a function which is sent to garbage when function is over.

Try importing outside the function

Upvotes: 4

Related Questions