Issue
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?
Solution
np.array
is not a class itself, it's just a convenience function to create annp.ndarray
.ndarray
is aliased to multiarray, which is implemented in C code (an extension module in .so/.pyd file, compiled code).- You can start looking at the ndarray interfaces here in numeric.py.
- Most of the meat of the implementation is in C code, here in multiarray.
array()
is implemented in _core/src/multiarray/methods.c inarray_getarray()
.
Answered By - wim
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.