- python
- >>> import numpy as np
- >>> foo = [[1,5,9]]
- >>> print (foo)
- [[1, 5, 9]]
- >>> print (np.average(foo))
- 5.0
- >>> a = np.array ([[1,5,9]])
- >>> print (a)
- [[1 5 9]]
- >>> a
- array([[1, 5, 9]])
- >>> a.shape
- (1, 3)
- >>> a.size
- 3
- >>> a.ndim
- >>> a.itemsize
- 8
- >>> a.dtype
- dtype(‘int64’)
- >>> b = np.array ([[1,2,3], [4,5,6]])
- >>> b
- array([[1, 2, 3],
- [4, 5, 6]])
- >>> b.shape
- (2, 3)
- >>> b.ndim
- 2
https://docs.scipy.org/doc/numpy-dev/user/quickstart.html
Advertisements