numpy中的ndarray与array的区别、不同
2017-09-14 22:02
686 查看
翻译自stackoverflow上的回答
https://stackoverflow.com/questions/15879315/what-is-the-difference-between-ndarray-and-array-in-numpy
问:What is the difference between ndarray and array in Numpy? And where can I find the implementations in the numpy source code?
(Numpy中ndarray和array的区别是什么?我在哪儿能够找到numpy中相应的实现?)
答:Well, np.array is just a convenience function to create an ndarray, it is not a class itself.
(嗯,np.array只是一个便捷的函数,用来创建一个ndarray,它本身不是一个类)
You can also create an array using np.ndarray, but it is not the recommended way. From the docstring of np.ndarray:
(你也能够用np.ndarray来创建,但这不是推荐的方式。来自np.ndarray的文档:)
Arrays should be constructed using array, zeros or empty … The parameters given here refer to a low-level method (ndarray(…)) for instantiating an array.
(Arrays 应该能用array,zeros 或empty来构造…这里的参数和一个实例化array的低层方法与有关)
Most of the meat of the implementation is in C code, here in multiarray, but you can start looking at the ndarray interfaces here:
https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py
https://stackoverflow.com/questions/15879315/what-is-the-difference-between-ndarray-and-array-in-numpy
问:What is the difference between ndarray and array in Numpy? And where can I find the implementations in the numpy source code?
(Numpy中ndarray和array的区别是什么?我在哪儿能够找到numpy中相应的实现?)
答:Well, np.array is just a convenience function to create an ndarray, it is not a class itself.
(嗯,np.array只是一个便捷的函数,用来创建一个ndarray,它本身不是一个类)
You can also create an array using np.ndarray, but it is not the recommended way. From the docstring of np.ndarray:
(你也能够用np.ndarray来创建,但这不是推荐的方式。来自np.ndarray的文档:)
Arrays should be constructed using array, zeros or empty … The parameters given here refer to a low-level method (ndarray(…)) for instantiating an array.
(Arrays 应该能用array,zeros 或empty来构造…这里的参数和一个实例化array的低层方法与有关)
Most of the meat of the implementation is in C code, here in multiarray, but you can start looking at the ndarray interfaces here:
https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py
相关文章推荐
- numpy中matrix 和 array的区别
- 论numpy中matrix 和 array的区别
- numpy中matrix 和 array的区别
- Python Numpy的数组array和矩阵matrix的用法与区别
- JSONArray构造方法在不同API上的区别
- Python中list和numpy.array的区别
- numpy之matrix和array的乘法区别
- numpy中matrix和array的区别
- 【转】]mysql_fetch_row, mysql_fetch_array, mysql_fetch_assoc的区别和不同
- 对numpy中array和asarray的区别详解
- numpy的asarray和array的区别
- 论numpy中matrix 和 array的区别
- numpy.array和numpy.matrix的一点小区别
- numpy中的matrix与array的区别
- 论numpy中matrix和array的区别
- numpy中matrix 和 array的区别
- [python]论numpy中matrix 和 array的区别
- <Python数据分析>numpy中array和asarray的区别
- numpy中matrix 和 array的区别
- numpy中matrix 和 array的区别