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?
C:\Users\<name>\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\numpy\core\multiarray.py is where I found it.
You can save your NumPy arrays to CSV files using the savetxt() function. This function takes a filename and array as arguments and saves the array into CSV format. You must also specify the delimiter; this is the character used to separate each variable in the file, most commonly a comma.
np.array
is not a class itself, just a convenience function to create an np.ndarray
ndarray
is just aliased to multiarray, which is implemented in C code (I think in an .so i.e. shared object, compiled code)array()
is implemented in core/src/multiarray/methods.c in array_getarray()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With