上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: True 阅读全文
posted @ 2018-03-09 19:53 郑哲 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 用线性数据画柱状图 1 plt.figure() 2 xvals = range(len(linear_data)) 3 plt.bar(xvals, linear_data, width = 0.3) 4 5 new_xvals = [] 6 7 # 创建new_xvals使横坐标向右移动0.3,用平方数据画红色的柱状图 8 for item in xvals: 9 ... 阅读全文
posted @ 2018-03-09 19:41 郑哲 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 错误代码 阅读全文
posted @ 2018-03-09 19:22 郑哲 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np 2 3 x = np.array([1,2,3,4,5,6,7,8]) 4 y = x 5 6 plt.figure() 7 plt.scatter(x, y) # similar to plt.plot(x, y, '.'), but the underlying child objects in the axes are not Line2D ... 阅读全文
posted @ 2018-03-09 18:47 郑哲 阅读(649) 评论(0) 推荐(0) 编辑
摘要: %%html<img src='test.png' /> 阅读全文
posted @ 2018-03-06 15:38 郑哲 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 1 r2 = r[:3,:3] 2 r2 array([[ 0, 1, 2], [ 6, 7, 8], [12, 13, 14]]) 1 r2[:] = 0 2 r2 array([[0, 0, 0], [0, 0, 0], [0, 0, 0]])此时r= array([[ 0, 0, 0, 3, 阅读全文
posted @ 2018-03-05 20:27 郑哲 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 s = np.arange(13)**2 2 s array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144]) 1 s[0], s[4], s[-1] (0, 16, 144) 1 s[1:5] array([ 1, 4, 9, 16]) 阅读全文
posted @ 2018-03-05 20:24 郑哲 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1 a = np.array([-4, -2, 1, 3, 5]) 2 a.sum() 3 1 a.max() 5 1 a.min() -4 1 a.mean() 0.60 1 a.std() 3.26 1 a.argmax() 4 1 a.argmin() 0 阅读全文
posted @ 2018-03-05 20:19 郑哲 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1 print(x + y) # elementwise addition [1 2 3] + [4 5 6] = [5 7 9] 2 print(x - y) # elementwise subtraction [1 2 3] - [4 5 6] = [-3 -3 -3] [5 7 9] [-3 阅读全文
posted @ 2018-03-05 20:17 郑哲 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1 import numpy as np %通过链表创建数组1 mylist = [1, 2, 3] 2 x = np.array(mylist) 3 x array([1, 2, 3]) %直接创建数组1 y = np.array([4, 5, 6]) 2 y array([4, 5, 6]) %创建多维数组1 m = np.array([[7, 8, 9], [10, 11,... 阅读全文
posted @ 2018-03-05 20:13 郑哲 阅读(113) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页