Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please Solve Using Python Numpy: Question 1: (4 points) A friend would like ndarray . reshape to figure out how many columns are needed given

Please Solve Using Python Numpy:

image text in transcribed
Question 1: (4 points) A friend would like ndarray . reshape to figure out how many columns are needed given that she'd like N values to be formed into R rows. She speculates that perhaps just providing one argument to reshape might cause the other to default, but it doesn't. For example, she tried to get three rows of four columns like this: >>> np. array (range (12 ) ) . reshape (3) ValueError: cannot reshape array of size 12 into shape (3, ) What could she do to get the number of rows automatically calculated? Be sure to provide an example of interaction for her! Question 2: (4 points) Fill in the blank! There is an ndarray method that behaves like this: >)> a = np. array (range (10) ) . ( ) >> >a array ( [ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45]) What's the name of the method? Show two interesting examples of using it

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

Students also viewed these Programming questions