Reputation: 3534
I built it myself on Python 3.3, but I can't for the life of me find the class definition of numpy.array()
. I've looked all through the code and even found the core C
files, but where is the dang array class??
Can anyone tell me what directory to look in, or how to find out from the python shell?
Upvotes: 27
Views: 10381
Reputation: 362945
np.array
is not a class itself, it's just a convenience function to create an np.ndarray
.ndarray
is aliased to multiarray, which is implemented in C code (an extension module in .so/.pyd file, compiled code).array()
is implemented in _core/src/multiarray/methods.c in array_getarray()
.Upvotes: 45