Y=
3.33
4.43
4.39
5.23
5.67
6.06
7.01
7.16
8.03
8.78
X =
1 5
1 10
1 15
1 20
1 25
1 30
1 35
1 40
1 45
1 50
and β =
v0
a
Problem 1. Create NumPy arrays X1 and Y1 using the values in the
above matrices X
and Y respectively.
Hint: recall that as Y1 is a vector, we create it in NumPy using a
command of the form
Y1=np.array([3.33,...,8.78]) and not
Y1=np.array([[3.33],...,[8.78]]).
import numpy as np
X1 = np.array([[1,5], [1, 10], [1, 15], [1, 20], [1, 25], [1, 30], [1, 35],
[1, 40], [1, 45], [1, 50]])
Y1 = np.array([3.33, 4.43, 4.39, 5.23, 5.67, 6.06, 7.01, 7.16, 8.03, 8.78])
print(X1.shape, type(X1))
print(" ")
print(Y1.shape, type(Y1))
Code and Output Screenshot
Get Answers For Free
Most questions answered within 1 hours.