摘要: https://www.runoob.com/python/os-listdir.html 阅读全文
posted @ 2021-04-21 09:23 id_ning 阅读(93) 评论(0) 推荐(0) 编辑
摘要: import numpy as np a = np.zeros([4,3]) print('前a:', a) a[0:3, 1] = 1 # 数组行(0,1,2)和列(1)的值变为1 print('后a:', a) 结果: 前a: [[0. 0. 0.] [0. 0. 0.] [0. 0. 0.] 阅读全文
posted @ 2021-04-20 17:12 id_ning 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 版权声明:本文为CSDN博主「象在舞」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/gdkyxy2013/article/details/80495353 阅读全文
posted @ 2021-04-20 16:46 id_ning 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 版权声明:本文为CSDN博主「雷格西雷狗子」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/weixin_45556441/article/details/110847939 阅读全文
posted @ 2021-04-20 16:28 id_ning 阅读(30) 评论(0) 推荐(0) 编辑
摘要: import numpy as np a = np.floor(2.3) # 向下取整 b = np.floor([1.6, -2.5]) print('a:', a) print('b:', b) a: 2.0 b: [ 1. -3.] import numpy as np c = np.ceil 阅读全文
posted @ 2021-04-19 09:39 id_ning 阅读(422) 评论(0) 推荐(0) 编辑
摘要: import numpy as np a = np.zeros((2,3), dtype=int) print(a) b = np.ones_like(a, dtype=int) print(b) 结果: a: [[0 0 0] [0 0 0]] b: [[1 1 1] [1 1 1]] 阅读全文
posted @ 2021-04-16 17:32 id_ning 阅读(139) 评论(0) 推荐(0) 编辑
摘要: import numpy as np a = np.array([i for i in range(5)]) b = np.array([i for i in range(5, 10)]) print('a:', a) print('b:', b) c = np.stack([a,b], axis= 阅读全文
posted @ 2021-04-16 10:10 id_ning 阅读(314) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/weixin_44201525/article/details/109769214 阅读全文
posted @ 2021-04-15 17:29 id_ning 阅读(28) 评论(0) 推荐(0) 编辑
摘要: print(round(1.2)) # 小数点后值小于0.5时,取最近的整数 1 1 print(round(1.5)) # 小数点后值等于0.5时,取最近的偶数 2 2 print(round(2.5)) # 小数点后值等于0.5时,取最近的偶数 2 2 print(round(1.6)) # 小 阅读全文
posted @ 2021-04-15 15:17 id_ning 阅读(306) 评论(0) 推荐(0) 编辑