摘要:
1 import numpy 2 from matplotlib import pyplot 3 x=numpy.linspace(-3,3,50) 4 y1=2*x+1 5 y2=x**2 6 7 8 pyplot.figure(num='第一幅图',figsize=(5,5)) 9 pyplot 阅读全文
posted @ 2020-06-17 14:21
马蹄哒哒
阅读(414)
评论(0)
推荐(0)
摘要:
import numpy from matplotlib import pyplot x=numpy.linspace(-3,3,50) y1=2*x+1 y2=x**2 #创建第一个画布 pyplot.figure() pyplot.plot(x,y1) #创减第二个画布 pyplot.figur 阅读全文
posted @ 2020-06-17 13:47
马蹄哒哒
阅读(214)
评论(0)
推荐(0)
摘要:
import numpy a=numpy.arange(12).reshape(3,4) b=a[:2,:2] #对子数组b中值进行修改,将会影响到a数组中的值 b[0][1]=1000 print(a) [[ 0 1000 2 3] [ 4 5 6 7] [ 8 9 10 11]] print(b 阅读全文
posted @ 2020-06-17 10:54
马蹄哒哒
阅读(163)
评论(0)
推荐(0)
摘要:
import numpy x=numpy.arange(1,13) a=x.reshape(4,3) #二维数组 #索引的使用 b=a[2] #获取第二行 c=a[2][2] #获取第二行的第三列 #切片的使用 d=a[:,:] #获取所有行与列 e=a[:,1] #获取所以行第二列的数据 f=a[ 阅读全文
posted @ 2020-06-17 10:43
马蹄哒哒
阅读(964)
评论(0)
推荐(0)
摘要:
import numpy a=numpy.arange(10) #索引访问,和字符串索引一样 print(a[-3]) print(a[2]) #切片访问 print(a[:]) print(a[3:4]) print(a[1:7:2]) print(a[::-1]) 阅读全文
posted @ 2020-06-17 10:21
马蹄哒哒
阅读(393)
评论(0)
推荐(0)

浙公网安备 33010602011771号