Guest User

Untitled

a guest
Feb 16th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import numpy as np
  2.  
  3. a = np.array([1.,2.,3.])
  4. print(a.shape)
  5. b = np.array([[1.,2.,3.]])
  6. print(b.shape)
  7.  
  8. #[output]:
  9. #(3,)
  10. #(1, 3)
  11.  
  12. #dtype-> It will let you know about the data type of stored values in the array.
  13. print(a.dtype)
  14.  
  15. #[Output]:
  16. #float64
  17.  
  18. #type-> It will return the type of object associated with the variable
  19. print(type(a))
  20.  
  21. #[Output]:
  22. #<class 'numpy.ndarray'>
Add Comment
Please, Sign In to add comment