Learn Before
Concept

NumPy ndarray attributes

Some important attributes of the ndarray object:

  • ndarray.dtype provides the data type of the elments in the array
  • ndarray.ndim tells us the number of axes (dimensions) in the array. For example. ndim will be 3 for a 3-dimensional array
  • ndarray.shape represents the size of the array in its dimensions in the form of a tuple of integers
  • ndarray.size is the number of elements in the whole array

0

2

Updated 2020-09-14

Tags

Data Science