Numpy
数据阿伯
这个作者很懒,什么都没留下…
展开
-
NumPy详细API第一篇
import numpy # 读取文件内容 world_alcohol = numpy.genfromtxt("world_alcohol.txt", delimiter=",",dtype="float",skip_header=1) print(type(world_alcohol)) print(world_alcohol) vector = numpy.array([1, 2, 3,原创 2017-03-09 20:48:09 · 2755 阅读 · 2 评论 -
NumPy详细API第二篇
以下代码是基于python3.5.0 import numpy # -----------------------判断数组中是否存在特定值------------------------------ vector = numpy.array([5, 10, 15, 20]) print(vector == 10) # 判断数组中有没有10,返回布尔值[False T原创 2017-03-09 20:50:53 · 681 阅读 · 0 评论 -
NumPy详细API第三篇
注意:以下代码是基于python3.5.0编写的 import numpy as np a = np.arange(15).reshape(3, 5) print(a) # array([[ 0, 1, 2, 3, 4],[ 5, 6, 7, 8, 9],[10, 11, 12, 13, 14]]) print(a.shape) #原创 2017-03-09 20:52:52 · 1470 阅读 · 0 评论 -
NumPy详细API第四篇
注意:以下代码是基于python3.5.0编写的 import numpy as np # ---------------exp和sqrt-------------------- B = np.arange(3) print(B) # [0 1 2] print(np.exp(B)) # [ 1. 2.71828183 7.3890原创 2017-03-09 20:54:09 · 928 阅读 · 0 评论 -
NumPy详细API第五篇
注意:以下代码是基于python3.5.0编写的 import numpy as np # ----------------------找最大值------------------------- data = np.sin(np.arange(20)).reshape(5,4) ind = data.argmax(axis=0) #按列找最大值的索引值原创 2017-03-09 20:56:26 · 497 阅读 · 0 评论