Numpy#
What do you need to do first, if you want to use Numpy?
# your code here
There are many different ways of creating a Numpy array for the sequence of the first 5 non-negative integers. Implement two of them here:
# your code here
Create an array of shape 3 x 4 which consists of all ones and one array of the transposed shape 4 x 3 which is full of zeros.
# your code here
Create an array with a sequence of 101 equally spaced numbers between 0 and \(2\pi\). What is the shape of the array? Calculate the cosine of this array.
# your code here
How do you take every 5th value of the array of cosines?
# your code here
How do you reverse the sign of the second half of the array?
# your code here
How do you reshape the array of cosines into one of shape 50 x 2?
# your code here
Create two arrays now: One contains the cosine of 100 equally spaced numbers between 0 and \(2\pi\) and one contains the sine of the same numbers. Reshape the array of cosines into shape 100 x 1. Then multiply both arrays.
# your code here
Now, visualize the product of the sine and the cosine array.
# your code here