0

i have a basic_dataset.py which contains the below function.

def getRowData():
    rowDt = np.full((80,20), -1)
    rowDt[:,0] =  np.random.choice([0,1,2],80) # Set the first column
    return  rowDt 

Then i made another file called main.ipynb, in the same directory, and tried to access getRowData() function using the below code:

import basic_dataset

basic_dataset.getRowData()

But, it complains with:

AttributeError: module 'basic_dataset' has no attribute 'getRowData'

I have seen this link, but i do not think, i can use it.

Jeff
  • 7,767
  • 28
  • 85
  • 138

1 Answers1

0

After fixing your code, You can restart your main.ipynb in jupyter notebook by clicking on the fast forward button (⏩) on the menu bar.

VietHTran
  • 2,233
  • 2
  • 9
  • 16