資料型別
描述bool_
boolean (true or false) stored as a byte
int_
default integer type (same as c long normally either int64 or int32)
intc
identical to c int (normally int32 or int64)
intp
integer used for indexing (same as c ssize_tnormally either int32 or int64)
int8
byte (-128 to 127)
int16
integer (-32768 to 32767)
int32
integer (-2147483648 to 2147483647)
int64
integer (-9223372036854775808 to 9223372036854775807)
uint8
unsigned integer (0 to 255)
uint16
unsigned integer (0 to 65535)
uint32
unsigned integer (0 to 4294967295)
uint64
unsigned integer (0 to 18446744073709551615)
float_
shorthand for float64.
float16
half precision float: sign bit, 5 bits exponent, 10 bits mantissa
float32
single precision float: sign bit, 8 bits exponent, 23 bits mantissa
float64
double precision float: sign bit, 11 bits exponent, 52 bits mantissa
complex_
shorthand for complex128.
complex64
complex number, represented by two 32-bit floats (real and imaginary components)
complex128
complex number, represented by two 64-bit floats (real and imaginary components)
單精度8位階碼,1位符號,剩下23位尾數,算出2的負23次方,得到0.00000011920928955078125
前面0有多少個,就表示能精確到那一位
雙精度11位階碼,1位符號,剩下52位尾數,算出2的負52次方,得到0.00000000000000022204460492503130808472633361816
前面0有多少個,就表示能精確到那一位
參考文獻
numpy 讀取資料
一 csv檔案 csv comma separated value,逗號分隔值檔案 顯示 狀態 原始檔 換行和逗號分隔,逗號 列,換行 行 二 讀取資料 1 方法 loadtxt fname,dtype float,delimiter none,skiprows 0,usecols none,unp...
GLSL 資料精度
1.預設精度 頂點著色器中預設精度 precision highp float precision highp int precision lowp sampler2d precision lowp samplercube 畫素著色器中預設精度 precision mediump int preci...
資料探勘工具numpy(三)Numpy索引和切片
通過幾個例項掌握numpy的索引和切片方法 import numpy as np file dir number.csv file dir表示檔案位置 delimiter表示資料之間的間隔符 dtype表示資料型別 unpack表示轉置 按列數逐行的讀取資料 t np.loadtxt file di...