摘要:
1234 """ 阅读全文
posted @ 2018-12-06 08:28
疯狂的骆驼
阅读(363)
评论(0)
推荐(0)
摘要:
import numpy as np ret = np.arange(3) print(ret) """ 运行结果 [0 1 2] """ import numpy as npret = np.array([1,2,3,4])print(ret)"""运行结果[1 2 3 4]""" import numpy as npret = np.ones(5)print(ret)ret2 = np.z... 阅读全文
posted @ 2018-12-06 07:20
疯狂的骆驼
阅读(270)
评论(0)
推荐(0)
摘要:
import numpy as np # 定义一个数组 test_array = np.array([[1 ,2 ,3] ,[3 ,4 ,5]]) ###数组简单的加减乘除法 # 加法 print(test_arra y +1) # 返回[[2 3 4][4 5 6]] # 减法 print(test_arra y -11) # 返回[[-10 -9 -8][ -8 -7 -6]] ... 阅读全文
posted @ 2018-12-06 06:56
疯狂的骆驼
阅读(676)
评论(0)
推荐(0)
摘要:
# 多个列表组合成一个列表 d = [['10', '22', '34', '46'],['11', '23', '35', '47'],['18', '23', '42', '06']]print(sum(d,[]))"""['10', '22', '34', '46', '11', ' 阅读全文
posted @ 2018-12-06 05:38
疯狂的骆驼
阅读(155)
评论(0)
推荐(0)
摘要:
python中itertools里的product和permutation 平时经常碰到全排列或者在n个数组中每个数组选一个值组成的所有序列等等问题,可以用permutation和product解决,很方便,所以在此mark一下吧 直接上代码 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ... 阅读全文
posted @ 2018-12-06 05:34
疯狂的骆驼
阅读(1605)
评论(0)
推荐(0)

浙公网安备 33010602011771号