Question: A Python question ! I have no idea how to use np.array() to store 1 million pi's Here is part of my code numpy.float32 (numpy.sin(numpy.pi))

 A Python question ! I have no idea how to use

A Python question !

I have no idea how to use np.array() to store 1 million pi's

Here is part of my code

numpy.float32 (numpy.sin(numpy.pi))

the output is 1.2246469e-16, but if using 32-bit precision, wouldn't the result be XXXX times 10^(-8) ? Why is it still 10^(-16)?

Part C (2 points) We're insulated from these issues with precision by using 64-bit floating point, but NumPy supports other representations that use small amounts of memory. Use the np, array() function to create another array with 1 million copies of , but this time in 32-bit precision (using data type np. float32 .) You should get a much larger accumulated error

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!