What function does this code call?

90 views Asked by At

I have this code from scikit docs:

import numpy as np
np.random.seed(1)

I understand what this code does semantically, but I cannot understand what this code actually calls.

Ok, numpy is a name of python module and np is just an alias for that. But what is np.random? Is it module inside of another module?

I found source code on GitHub and random is just a folder inside of numpy directory. So numpy should be a package, not a module?

1

There are 1 answers

3
Christian W. On

Numpy is a package, that contains module random which contains method seed.