机器学习
文章平均质量分 70
弱鸡_CQUPT
这个作者很懒,什么都没留下…
展开
-
Numpy的基本使用:创建ndarray:
ndarray:一种n维数组对象作用:大数据容器特点:同构数据多维容器,即其中的所有元素必须是相同类型,每个数组都有一个shape和一个dtypeshape:一个表示各维度大小的元组dtype:一个用于说明数组数据类型的对象创建ndarray:1.使用array函数(np.array())1>数字import numpy as np data1 = [6,7.5,8,0,1] arr1 = ...原创 2018-02-11 11:25:58 · 1068 阅读 · 0 评论 -
Numpy基本用法:ndarray的数据类型
print '生成指定元素类型的数组:设置dtype属性' x = numpy.array([1,2.6,3],dtype = numpy.int64) print x # 元素类型为int64 print x.dtype x = numpy.array([1,2,3],dtype = numpy.float64) print x # 元素类型为float64 print x.dtype pri...转载 2018-02-11 20:11:43 · 12630 阅读 · 0 评论