Question: Using the numpy.sin ( ) and numpy.cos ( ) functions along with numpy.pi , write a script that creates the 1 D array [ cos

Using the numpy.sin() and numpy.cos() functions along with numpy.pi, write a script
that creates the 1D array
[cos (0), sin (\pi ), sin (\pi /3), cos (\pi /3)],
and assign it to ans1. Additionally, assign the following variables to
a.) ans2=(\pi /2) ans1
b.) ans3= sin(ans1)
c.) ans4= ans2 ans3
d.) Now use the : slicing operator to create an array that consists of the first two
elements of ans3 and assign it to ans5. Create another array that is the last two
elements of ans4 and assign it to ans6. Finally, compute ans5-ans6 and assign it
to ans7.
3

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!