Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please only solve ##Q2. I provided the first part for Array1. #Exercise 1 [30 Points] ##Q1. [12 Points] Create array Array1 that contains the following

image text in transcribed

Please only solve ##Q2. I provided the first part for Array1.

image text in transcribed

#Exercise 1 [30 Points] ##Q1. [12 Points] Create array Array1 that contains the following elements: [1.1, 1.2, 1.3, ..., 30.0] . Generate Array2 from Array1 that follows The 1st element in Array2 is the 1st element in Array1. . Starting from the 2nd element in Array 2, we have o the 2nd element in Array2 is the 2nd element in Array1 minus the 1st element in Array 1 o the 3rd element in Array2 is the 3rd element in Array1 minus the 2nd element in Array1 the 4th element in Array2 is the 4th element in Array1 minus the 3rd element in Array1 . Based on a conditional statement with 3 branches, print out which condition the average of the Array2 satisfies (1) smaller than 0.11 (2) between 0.11 and 0.13 (3) higher than 0.13. Compute the sum of square roots of all the even elements in Array1 (2nd element, 4th element, 6th element,...). For this question, np.repeat, np.linspace functions, and loops are not allowed. In [@]: #Create Array1 Array1=np. linspace(1,30,300) print(Array1) In [@]: #Create Array2 print(Array) In [@]: #Construct your conditional statement here In [@]: #Compute the sum of the square roots of all the even elements in Array1 ##Q2. [8 Points] Convert Array1 to a list List1. Run a for loop 50 times. Each time, append an element equals the last element of List 1 plus 0.2 to the back of List1. Print out the last 10 elements of List1. In [O]: N #Convert Array to a list Listi print(List1) In [0]: N #Construct your `for Loop here print(List1) In [O]: #Print out the last 10 elements of Listi

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions