Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question contains (a) (b) question. Write a function to create a 2D array of arbitrary shape. This array should have all zero values, except

image text in transcribedimage text in transcribedThis question contains (a) (b) question.

Write a function to create a 2D array of arbitrary shape. This array should have all zero values, except for the elements around the border (i.e., the first and last rows, and the first and last columns), which should have a value of one. def border (n, m): "Creates an array with shape (n, m) that is all zeros except for the border (i. e., the first and last rows and columns), which should be filled with ones. Hint: you should be able to do this in three lines (including the return statement) Parameters n, m: int Number of rows and number of columns Returns numpy array with shape (n, m # YOUR CODE HERE # Show work Below a 2D array, A88 is created that reshapes the integers 1 through 64 into an 8 X 8 array. Create a new 1-D array that only contains the last column of a8 e.g. [8, 16, 24, 32, 40, 48, 56, 64] . A88 = np. arange (1, 65). reshape (8,8) #a8 = your work

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago