- creation
- slicing : is view
- fancy indexing : is copy
- arithmetic operators apply element wise, new array is created
- universal functions(
ufunc), element wise - different type upcast to more general one
arr.flatten()make a copy,arr.ravel()make a viewf
References:
1. http://wiki.scipy.org/Tentative_NumPy_Tutorial
2. http://scipy-lectures.github.io/intro/numpy/array_object.html
本文详细介绍了NumPy中的一些核心概念,包括创建数组的方式、切片操作是否产生视图、花式索引是否复制数据、算术运算如何作用于元素、通用函数的应用范围以及不同数据类型之间的转换规则等。此外,还探讨了flatten与ravel两种展平数组的方法及其区别。
18万+

被折叠的 条评论
为什么被折叠?



