Nbdev function from a different notebook

Hello,
I am currently trying to import a function from 01_functions.ipynb in my index.ipynb. All the notebooks are in the root directory. The commands nbdev_build_lib, nbdev_build_docs all have worked alright.

The function I am trying to import is

def normalize(data):
    """
    Normalizes the input
    """
    return (data - np.min(data)) / (np.max(data) - np.min(data)).

When I try to use this function in index.ipynb using from demo_nb import *
( I have added from .functions import * in _init_.py)

I don’t know what it is wrong over here? I tried searching the forums on this issue.

Do you have “import numpy as np” in an export cell in that original notebook?

1 Like

I have the import statements in a hide cell.

It worked! I changed the comment from hide to export and it worked. Thank you!!