来源:https://www.numpy.org/devdocs/user/quickstart.html

:即维度

eg.

  • [1, 2, 1],有一个轴
  • [[ 1, 0, 0],[ 0, 1, 2]] ,有两个轴,第一个个轴的长度是2,第二个轴的长度是3

ndarray:numpy的数组类,也叫数组

常用的ndarray属性有:

ndarray.ndim
the number of axes (dimensions) of the array.

ndarray.shape
the dimensions of the array. This is a tuple of integers indicating the size of the array in each dimension. For a matrix with n rows and m columns, shape will be (n,m). The length of the shape tuple is therefore the number of axes, ndim.

ndarray.size
the total number of elements of the array. This is equal to the product of the elements of shape.

ndarray.dtype
an object describing the type of the elements in the array. One can create or specify dtype’s using standard Python types. Additionally NumPy provides types of its own. numpy.int32, numpy.int16, and numpy.float64 are some examples.

ndarray.itemsize
the size in bytes of each element of the array. For example, an array of elements of type float64 has itemsize 8 (=64/8), while one of type complex32 has itemsize 4 (=32/8). It is equivalent to ndarray.dtype.itemsize.

ndarray.data
the buffer containing the actual elements of the array. Normally, we won’t need to use this attribute because we will access the elements in an array using indexing facilities.

Numpy的基本概念的更多相关文章

  1. Python数据分析 | Numpy与1维数组操作

    作者:韩信子@ShowMeAI 教程地址:http://www.showmeai.tech/tutorials/33 本文地址:http://www.showmeai.tech/article-det ...

  2. 想学Python?这里有一个最全面的职位分析

    Python从2015年开始,一直处于火爆的趋势,目前Python工程师超越Java.Web前端等岗位,起薪在15K左右,目前不管是小公司还是知名大公司都在热招中. 当然,每个城市对岗位的需求也不尽相 ...

  3. 阿里重磅开源首款自研科学计算引擎Mars,揭秘超大规模科学计算

    日前,阿里巴巴正式对外发布了分布式科学计算引擎 Mars 的开源代码地址,开发者们可以在pypi上自主下载安装,或在Github上获取源代码并参与开发. 此前,早在2018年9月的杭州云栖大会上,阿里 ...

  4. Tensor基本理论

    Tensor基本理论 深度学习框架使用Tensor来表示数据,在神经网络中传递的数据均为Tensor. Tensor可以将其理解为多维数组,其可以具有任意多的维度,不同Tensor可以有不同的数据类型 ...

  5. Tensor基础实践

    Tensor基础实践 飞桨(PaddlePaddle,以下简称Paddle)和其他深度学习框架一样,使用Tensor来表示数据,在神经网络中传递的数据均为Tensor. Tensor可以将其理解为多维 ...

  6. Numpy中重要的广播概念

    Numpy中重要的广播概念 广播:简单理解为用于不同大小数组的二元通用函数(加.减.乘等)的一组规则 广播的规则: 如果两个数组的维度数dim不相同,那么小维度数组的形状将会在左边补1 如果shape ...

  7. Numpy常用概念-对象的副本和视图、向量化、广播机制

    一.引言 在我们操作数组的时候,返回的是新数组还是原数组的链接,我们就需要了解对象副本和视图的区别. 向量化和广播是numpy内部实现的基础. 二.对象副本和视图 我们应该注意到,在操作数组的时候返回 ...

  8. NumPy学习1:基本概念

    NumPy的数组类被称作 ndarray .通常被称作数组.注意numpy.array和标准Python库类array.array并不相同,后者只处理一维数组和提供少量功能.更多重要ndarray对象 ...

  9. 利用Python进行数据分析(5) NumPy基础: ndarray索引和切片

    概念理解 索引即通过一个无符号整数值获取数组里的值. 切片即对数组里某个片段的描述. 一维数组 一维数组的索引 一维数组的索引和Python列表的功能类似: 一维数组的切片 一维数组的切片语法格式为a ...

随机推荐

  1. [PRIMITIVE TECHNOLOGY]澳洲小哥的黑皮豆/black been/摩顿湾板栗(栗子)/Moreton Bay Chestnut

    wiki:https://en.wikipedia.org/wiki/Castanospermum inner:http://blog.sciencenet.cn/blog-309517-770951 ...

  2. 【简】题解 AWSL090429 【噪音】

    因为每次加上一头奶牛 是什么不重要 牛棚之间贡献除清空操作外无影响 就只要考虑 每个牛棚清空分x次 的贡献 x之和为k       求贡献和最小 一个牛棚清空x次 显然平均清空贡献最小 再用等差数列的 ...

  3. 定向耦合器 Directional Couplers

    microwave101,干货比较多 传送门:https://www.microwaves101.com/encyclopedias/directional-couplers Directional ...

  4. 关于java环境变量配置出现javac命令无法运行的解决办法

    昨天一时兴起给电脑刷了机,想着给电脑装个Win10+Linux的双系统, 结果双系统没装好,所有的东西又得重新弄一遍 今天在配置java的时候又出问题了 java,java-version运行成功了, ...

  5. Java基础--面向对象编程4(多态)

    1.多态的概念 多态是指程序中的同一引用类型,使用不同的实例而执行结果不同的. 同一个类型:一般指父类 不同的实例:不同的子类实例 执行结果不同:针对同一方法执行的结果不同 package cn.sx ...

  6. Exp6 信息收集与漏洞扫描

    一.实践过程 1.信息收集 1.1 通过DNS和IP查询目标网站的信息 (1)whois命令用来进行域名注册信息查询,可查询到3R注册信息,包括注册人的姓名.组织和城市等信息. whois baidu ...

  7. trackerClient.getConnection()为null

    如题,整了个fastDFS文件服务器.但是集成项目spring boot时上传文件失败! Debug到trackerClient.getConnection()时为null.于是看了服务器上track ...

  8. Angular记录(5)

    文档资料 箭头函数--MDN:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions/Arrow_fun ...

  9. (三)初探maven之使用IDE

    一.在IDE中使用maven 打开Eclipse,在菜单栏依次选中window   => preferences  => Maven  => Installations , 然后添加 ...

  10. (Python3) 九九乘法表 代码

    for i in range(1,10): for j in range(1,10): print(i '*' j '=', i*j)