- 博客(4)
- 资源 (5)
- 收藏
- 关注
原创 numpy轴变化和np.transpose的通用理解
np.transposeimport numpy as npa = np.arange(24).reshape(2, 3, 4)print(a)# 替换的是原来的位置形状# [[[ 0 1 2 3]# [ 4 5 6 7]# [ 8 9 10 11]]## [[12 13 14 15]# [16 17 18 19]# [20 21 22 23]]]print("维度0的0部分", a[0])# [[ 0 1 2 3]# [ 4 5 6
2022-01-04 19:41:21
950
原创 python累加的几种方法
# 使用Python自带工具from itertools import accumulateres = accumulate(range(10))print(list(res))# 使用numpyimport numpy as npr=np.cumsum(np.array(range(10)))print(list(r))
2020-02-02 00:02:14
4768
原创 python csv写入和读取csv文件
python csv写入import csv# 只有,号分隔在excel中打开是多列,其他分隔符是一列# 不加newline windows下回多一个空行 不加encoding 编码随系统with open("a.csv", "w", encoding="utf-8",newline="") as f: writer = csv.writer(f, delimiter=...
2020-02-01 22:54:21
336
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人