numpy基础
2016-05-22 20:55
267 查看
1.dtype类的属性:
t = dtype('float64')
t.char #数据类型的字符编码
t.type #数组元素的数据类型
t.str #数据类型的字符串表示
<为小端排序,最低字节存储在最低的内存地址
>为大端排序,最高字节存储在最高的内存地址
2.自定义数据类型
t = dtype([('name',str,40),('numitems',int),('price',float)])
itemz = array([('add',1,2),('fd',2,3)],dtype=t)
t = dtype('float64')
t.char #数据类型的字符编码
t.type #数组元素的数据类型
t.str #数据类型的字符串表示
import numpy as np t = np.dtype('float64') print t.char print t.type print t.str
<为小端排序,最低字节存储在最低的内存地址
>为大端排序,最高字节存储在最高的内存地址
2.自定义数据类型
t = dtype([('name',str,40),('numitems',int),('price',float)])
itemz = array([('add',1,2),('fd',2,3)],dtype=t)
相关文章推荐
- python getopt 用法
- 利用python模拟登录
- Python之greenlet学习
- python实现计算器
- python zip( )函数
- python核心编程2
- 【Python】使用cmd模块构造一个带有后台线程的交互命令行界面
- Python面向对象编程-封装
- pyenv 环境构造多python环境
- Python调用R语言
- python 进行文本相似性对比
- 用python写一个简单的推荐系统
- Python函数及使用函数进行面向过程封装
- Python_1_数据类型及变量
- python 有道翻译
- pgloader
- python学习03-数字
- 一个纯小白的安装python库的郁闷之旅
- Python 资源大全中文版
- python3 module中__init__.py的需要注意的地方