explain with an example how arrays are created using ones() and zeros () function
Answers
Answered by
1
Explanation:
The shape is an int or tuple of ints to define the size of the array. If we just specify an int variable, a one-dimensional array will be returned. For a tuple of ints, the array of given shape will be returned.
The dtype is an optional parameter with default value as a float. It’s used to specify the data type of the array, for example, int.
The order defines the whether to store multi-dimensional array in row-major (C-style) or column-major (Fortran-style) order in memory.
Similar questions