Question: Q3. [10 points] Generate the following array Array3: (3.6, 1.43, 2.4, 4.3, 5.43, 6.5). Define distance between two points x 1 and 2 using X1-x2).

 Q3. [10 points] Generate the following array Array3: (3.6, 1.43, 2.4,

Q3. [10 points] Generate the following array Array3: (3.6, 1.43, 2.4, 4.3, 5.43, 6.5). Define distance between two points x 1 and 2 using X1-x2). Compute the average distance between every point in Array 3 and the mean of Array3. Based on np.array() function, manually define a Boolean array Boolean1 to indicate whether each element in Array 3 is below 5. Based on np.array() function, manually define a Boolean array Boolean2 to indicate whether each element is Array 3 is above 3. . Based on the two Boolean arrays defined above, use Boolean array operation to construct a Boolean array Boolean3 to indicate whether each element is above 3 and below 5 in Array Using the Boolean array as a mask, keep only elements in Array 3 that are above 3 and below 5. In this question, you cannot use Loop. In [@]: #construct Array3 print(Array3) In [@]: #construct distance array print(Distance) In [O]: #construct Boolean1 array print(Booleanl) In [@]: #construct Boolean2 array print(Boolean2) In [@]: #construct Boolean array print(Boolean3) In [@]: #Array3_sub contains only elements above 3 and below 5. print(Array3_sub)

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 Databases Questions!