Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Outline

Write a function which creates a numpy array of dimensions (3, 3, 3) by following the steps below

Awesome, you are a quick learner , now let's do some more task to hone your skills of numpy basics. Your job is to construct a numpy array under the function name of create_3d_array.

The function should

  • Accept no parameters
  • Return a numpy array with the said dimensions

Steps:

  • Calculate the number of values that will be stored in an array of these dimensions. Let's call the count N.
  • Create an array of numbers from 0 to N-1 (total N elements)
  • Reshape this array into the desired dimensions
  • Return the array

These steps will result in a unique numpy array. Your solution will be only accepted as correct if your function generates an array that matches ours. Solving this will provide you additional experience and better understanding on how numpy array and its dimensions are related.

Parameters:

This function takes in no parameters

Returns

This function returns an numpy array of dimensions (3,3,3)

Morty Proxy This is a proxified and sanitized view of the page, visit original site.