python_intermediate_project/q03_create_3d_array at master · samir0719/python_intermediate_project · GitHub
Skip to content

Latest commit

 

History

History
 
 

Folders and files

README.md

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)