摘要:
一、取行 1、单行 数组[index, :] # 取第index+1行 例子 import numpy as np arr1 = np.arange(0, 24).reshape(4, 6) # 取第2行数据 row1 = arr1[1, :] print(row1) 2、连续的多行 数组[star 阅读全文
posted @ 2019-11-28 23:29
市丸银
阅读(170)
评论(0)
推荐(0)
摘要:
一、CSV文件 CSV: Comma-Separated Value,逗号分隔值文件 显示:表格状态 源文件:换行和逗号分隔,逗号 列,换行 行 二、读取数据 1、方法 loadtxt(fname, dtype=float, delimiter=None, skiprows=0, usecols=N 阅读全文
posted @ 2019-11-28 23:27
市丸银
阅读(776)
评论(0)
推荐(0)
摘要:
一、数组和数的计算 数组和数计算,数组中的每个元素和数进行计算 1、加 import numpy as np arr1 = np.arange(12).reshape(3, 4) print(arr1) # 数组的每个元素和数进行加法运算 arr2 = arr1 + 2 print(arr2) 2、 阅读全文
posted @ 2019-11-28 23:25
市丸银
阅读(562)
评论(0)
推荐(0)
摘要:
一、基础知识 1、安装 conda install numpy 2、什么是numpy?Python中做科学计算的基础库,重在数值计算 二、创建数组 import numpy as np # 方式一 np.array([1, 2, 3, 4, 5]) # 方式二 np.array(range(5)) 阅读全文
posted @ 2019-11-28 18:03
市丸银
阅读(221)
评论(0)
推荐(0)

浙公网安备 33010602011771号