Question
Python programming a) Create an array that starts in 33, ends in 5.55.5, and has 49 elements equally spaced. Assign the array to a variable
Python programming
a) Create an array that starts in 33, ends in 5.55.5, and has 49 elements equally spaced. Assign the array to a variable named first_array.
b) Create an array that starts with the element 2323, ends in 992992 (including it), and steps by 1717 (i.e., 23,40,...,975,99223,40,...,975,992 ). Assign the array to a variable named second_array.
c) Given two arrays, array_one and array_two, use slicing to multiply element-wise the 21st to 35th elements of array_one with the 22nd to 36th elements of array_two, assign the resulting array to a variable named slice_prod.
Hint: the index of the 1st element in an array is 00 in Python.
# DO NOT MODIFY THIS CELL
numpy.random.seed(108)
array_one = numpy.random.rand(100)
array_two = numpy.random.rand(100)Exercise 2 a) Create an array that starts in -3, ends in 5.5, and has 49 elements equally spaced. Assign the array to a variable named first_array. In [ ]: YOUR CODE HERE raise NotImplementedError() In (): b) Create an array that starts with the element 23, ends in 992 (including it), and steps by 17 (i.e., 23,40,...,975,992). Assign the array to a variable named second_array In (): YOUR CODE HERE raise NotImplementedError() In [ ]: c) Given two arrays, array_one and array_two, use slicing to multiply element-wise the 21st to 35th elements of array_one with the 22nd to 36th elements of array_two, assign the resulting array to a variable named slice_prod. Hint: the index of the 1st element in an array is 0 in Python. In [ ]: # DO NOT MODIFY THIS CELL numpy.random. seed(108) array_one - numpy.random.rand(100) array two - numpy.random.rand (100)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started