Question: Create two 2 - dimensional NumPy array of 2 rows and 5 columns with values ranging from - 5 to 5 ( inclusive ) with

Create two 2-dimensional NumPy array of 2 rows and 5 columns with values ranging from -5 to 5(inclusive) with a step size of 1(Hint: Use np.reshape(), np.array())(25 points
a. Compute the Euclidean distance for each point \((\mathrm{X},\mathrm{Y})\) from the origin \((0,0)\).(Hint: euclidean distance \(\left.=\operatorname{sqrt}\left((x 2-x 1)^{\wedge}2+(y 2-y 1)^{\wedge}2\right)\right)\). Expected output is a 2 X 5 numpy array, with each value representing the distance from the origin
(give them the sample matrices)
b. Create a new 2-Dimensional array Z with same number of rows and columns and use Conditional Logic for array operations to:
- Assign \( Z[i, j]=1\) for points whose distance is less than 5.
- Assign \( Z[i, j]=2\) for points whose distance is between 5 and 10.
- Assign \( Z[i, j]=3\) for points whose distance is greater than 10.
c. Find and print the minimum value, maximum value, cumulative sum, cumulative product, arithmetic mean, sum, standard deviation, variance, Indices of Minimum and and Maximum Elements of the Array Z.
Create two 2 - dimensional NumPy array of 2 rows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!