type
status
date
slug
summary
tags
category
icon
password
1.什么是ndarray对象
NumPy 定义了一个 n 维数组对象,简称 ndarray 对象
它是一个一系列相同类型元素组成的数组集合。数组中的每个元素都占有大小相同的内存块
2.创建ndarray对象
通过 NumPy 的内置函数 array() 可以创建 ndarray 对象,其语法格式如下:
1 | object | 表示一个数组序列。 |
2 | dtype | 可选参数,通过它可以更改数组的数据类型。 |
3 | copy | 可选参数,表示数组能否被复制,默认是 True。 |
4 | order | 以哪种内存布局创建数组,有 3 个可选值,分别是 C(行序列)/F(列序列)/A(默认)。 |
5 | ndim | 用于指定数组的维度。 |
3.如何看数组的形状
从外向里看
- Author:孟浩
- URL:MengHaoの博客 | 行而不辍,未来可期/article/1c330b52-583a-8041-99c8-e2e907fd7562
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!