Advertisement



< Prev
Next >



Python - two-dimensional Array









Creating a two-dimensional array in Python


To create a 2D array, we need to import the numpy module and call its zeros() method, just like we did when we created a 1D array, though this time, there is a slight difference in the number of parameters we call the zeros() function with.

Note : Calling the zeros method, will create an array with all its elements initialized to zero. Let us look at the syntax of this function.


Syntax of zeros() function -
zeros(shape, datatype, order)

Please Subscribe

Please subscribe to our social media channels for daily updates.


Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page




Advertisement



Notifications



Please check our latest addition

C#, PYTHON and DJANGO


Advertisement