I've written a python file and am trying to import it but it's not recognized.
The file was saved as gentleboost_c_class.c in C:\User\apps\My documents.
I tried to import it like this:
import gentleboost_c_class as gbc
But I get this error:
NameError: name 'gentleboost_c_class' is not defined
gentleboost_c_class.py begins like this:
from sklearn.externals.six.moves import zip
import numpy as np
import statsmodels.api as sm
class GentleBoostC:
.....
It compiles fine. Both files are in the same folder. What am I doing wrong?
gentleboost_c_class.pybut the other file)NameError, not anImportError. Seems to me that you import your module asgbc, but later try to refer to it asgentleboost_c_class.gbc(). What are you actually trying to do? Instanciate the classGentleBoostC? Then it would begbc.GentleBoostC().