Importing Pandas gives error AttributeError: module 'pandas' has no attribute 'core' in iPython Notebook
"Have you tried turning it off and on again?" (Roy of The IT crowd)
This happened to me today, which is why I ended up to this page. Seeing that error was weird since, recently, I have not made any changes in my Python environment. Interestingly, I observed that if I open a new notebook and import pandas
I would not get the same error message. So, I did shutdown
the troublesome notebook and started it again and voila it is working again!
Even though this solved the problem (at least for me), I cannot readily come up with an explanation as to why it happened in the first place!
There's this bug in the latest version of pandas (pandas 0.23) that gives you an error on importing pandas.
But this can be easily fixed by installing an earlier version of pandas (pandas 0.22) using the command pip install pandas==0.22
on Windows Command Prompt.
Apparently the error I got when trying to import pandas for the first time was ValueError: unknown locale: UTF-8
Trying to import again afterwards, gave another error as described in my question above.
I found the solution to solve the ValueError on IPython Notebook locale error
After updating my bash profile, the error AttributeError: module 'pandas' has no attribute 'core'
did not appear anymore.