Skip to content
Advertisement

I get error , cannot import from file helper

Please help, I get the error below running jupyter notebook.

import numpy as np
import pandas as pd
from helper import boston_dataframe

np.set_printoptions(precision=3, suppress=True)

Error:

ImportError                               Traceback (most recent call last)
<ipython-input-3-a6117bd64450> in <module>
      1 import numpy as np
      2 import pandas as pd
----> 3 from helper import boston_dataframe
      4 
      5 

ImportError: cannot import name 'boston_dataframe' from 'helper' (/Users/irina/opt/anaconda3/lib/python3.8/site-packages/helper/__init__.py)

Advertisement

Answer

Since you are not giving the where you get the notebook, I have to guess that you get it from this course Supervised Learning: Regression provided IBM.

In the zip folder in week 1, it provides helper.py.

labwork

What you need to do it is to change the directory to where this file is. Change IPython/Jupyter notebook working directory

Alternatively, you can load boston data from sklearn then load it to Pandas Dataframe

Advices for you:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement