![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
十年空空梦
代码改变世界!
展开
-
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 阅读 · 0 评论 -
git简明使用查看手册
学无止境,苦海无涯。git篇原创 2020-04-28 22:50:56 · 129 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 · 337 阅读 · 0 评论