Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function to create an n by d np.ndarray of an integer type with numbers from 0 to k (exclusive) filled in. The numbers

Write a function to create an n by d np.ndarray of an integer type with numbers from 0 to k (exclusive) filled in. The numbers should be arranged in order and along the rows. For example, with k=100, n=20 and d=5, your function should return:

array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], ... [90, 91, 92, 93, 94], [95, 96, 97, 98, 99]])

This function should return an integer np.ndarray of shape (n, d).

def create_array(k, n, d): """ This function returns an n by d matrix with numbers from 0 to k (exclusive) filled in. """ assert n * d == k, "Q1: The values of n and d are not compatible with the value of k. " array = None # YOUR CODE HERE # raise NotImplementedError() return array

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

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

What are the basics of culture?

Answered: 1 week ago