Converting lists to ndarrays . An ndarray is made of two parts:.We can also merge multiple NDArrays . The more important properties of an NdArray object are:. Any sequence that can be interpreted as an ndarray .
接下来,分别在CPU和GPU上创建NDArray 。 Next, create an NDArray on both the CPU and GPU. The more important properties of an NdArray object are:. 我们可以通过shape属性来获取NDArray 实例形状。 We can get the NDArray instance shape through the shape property. 例如,ndarray 是一个类,拥有许多方法和属性。 For example, ndarray is a class, possessing numerous methods and attributes. 我们可以通过shape属性来获取NDArray 实例的形状。 We can get the NDArray instance shape through the shape property. 例如,ndarray 是一个类,它拥有许多方法和属性。 For example, ndarray is a class, possessing numerous methods and attributes. 在上面的示例中,ndarray Object是通过arange()函数准备的。 In the above example, an ndarray object is prepared by arange() function. 正如你在上面的代码中看到的,NumPy数组实际上被称为ndarray 。 As you can see in the above code a NumPy array is actually called an ndarray . Ndarray 或其子类之一(这实际上是使用data属性所做的)。Ndarray or one of its subclass(which is actually what using the data attribute does). 如你所看,在上边的代码中NumPy的数组其实被称为ndarray 。 As you can see in the above code a NumPy array is actually called an ndarray . 更改ndarray 的大小将创建一个新数组并删除原始数组。 Changing the size of an ndarray will create a new array and delete the original. Numpy中定义的最重要的对象是称为ndarray 的N维数组类型。 The most important object defined in NumPy is the N-dimensional array type called ndarray . 更改ndarray 的大小将创建一个新数组并删除原来的数组。 Changing the size of an ndarray will create a new array and delete the original. NumPy中定义的最重要的Object是称为ndarray 的N维数组类型。 The most important object defined in NumPy is the N-dimensional array type called ndarray . Ndarray 是一个通用的同构数据多维容器,也就是说,其中的所有元素必须是相同类型的。Ndarrays are homogeneous data objects, i.e. all elements of an array have to be of the same data type. 我不知道为什么他妈的它叫ndarray ,如果有人知道请留言!我猜它代表n维数组。! I don't know why it's called an ndarray , if anyone knows please leave a comment! 为了以特定顺序选取子集,只需传入一个指定顺序的整数列表或ndarray 即可:. To select a subset of rows in a specific order, simply pass in a list of integers or ndarray s for the specified order:. Ndarray 是一个同种类数据的多维容器,也就是说,它的所有元素都是同类型的。An ndarray is a generic multidimensional container for homogeneous data; that is, all of the elements must be the same type. 许多非数组运算,如计算数组所有元素之和,被作为ndarray 类的方法实现. Many unary operations, such as computing the sum of all the elements in the array, are implemented as methods of the ndarray class. Ndarray 是一个通用的同构数据多维容器,也就是说,其中的所有元素必须是相同类型的。An ndarray is a generic multidimensional container for homogeneous data; that is, all of the elements must be the same type. 许多类似于求数组所有元素的和的一元操作都是作为ndarray 类的方法实现的。 Many unary operations, such as computing the sum of all the elements in the array, are implemented as methods of the ndarray class. 从ndarray Object提取(通过切片)的任何项都由数组标量类型之一的PythonObject表示。 Any item extracted from the ndarray object(by slicing) is represented by a Python object of one of array scalar types. 许多一元操作,例如计算数组中所有元素的总和,都是作为ndarray 类的方法实现的。 Many unary operations, such as computing the sum of all the elements in the array, are implemented as methods of the NdArray class:. Dtype(数据类型)是一个特殊的对象,它含有ndarray 将一块内存解释为特定数据类型所需的信息:. The dtype is a special object containing the information the ndarry needs to interpret a chunk of memory as a particular type of data:.这种灵活性使NumPy数组方言和NumPyndarray 类成为在Python中使用的多维数据交换的首选对象。 This flexibility has allowed the NumPy array dialect and NumPy ndarray class to become the de-facto language of multi-dimensional data interchange used in Python.
展示更多例子
结果: 70 ,
时间: 0.0191
English
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt