Question: python question (a) The following code creates three arrays: t, t2 and t3. Modify the code to: plot t as green triangles plot t2 as
python question
(a)The following code creates three arrays: t, t2 and t3. Modify the code to: plot t as green triangles plot t2 as blue squares plot t3 as black circles plot t4 as a dashed-red line plot them as 2x2 subplots
multilineplot.py
import numpy as np import matplotlib.pyplot as plt t = np.arange(0., 5., 0.2) t2 = t**2 t3 = t**3 t4 = t**4 #plt.plot(t, t, t, t2, t, t3, t, t4) #plt.show()
(b)What would be the output of the following code, resizeme.py?
resizeme.py
import numpy as np data = np.zeros((2,2,2)) data[1,0,1] = 1 data[0,1,0] = 2 data = data*3 print(data) data = data + 10 data.resize(1,8) print(data)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
