I am using VS code, I am trying to do a project using Jupyter notebook on VS code. I tried typing [import pandas as pd] after installing pandas using pip. I pressed the run button and nothing visible changed except the bracket for the cell turning to 1. [-] -> [1]
How can I know if this import was successful?
Edit: Ok I understand how to tell now, Thank You everyone!
if you use
import pandas as pd
if it runs without ModuleNotFoundError: No module named 'pandas'
it should be working.
Generally speaking, you do not have to worry much about this issue, no output means you have imported a module successfully or it will give some err like ModuleNotFoundError
.
If you want to confirm this, there are 2 ways I can provide:
pd.__version__
if it gives a version number and doesn't report any err, you success.
import sys
sys.module.keys()
and if pandas
is in the output list, it has been imported.
you can use an example to test if it works, try this
dates = pd.date_range('20130101', periods=6)
print(dates)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.