Created
February 14, 2019 16:28
-
-
Save Robofied/68a52f983fcc7e8b38c1064d0c201963 to your computer and use it in GitHub Desktop.
Numpy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a = np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12]]) | |
print(a) | |
#[Output]: | |
#[[ 1 2 3] | |
# [ 4 5 6] | |
# [ 7 8 9] | |
# [10 11 12]] | |
# It will return the no. of axes so here 2 because it has rows and columns | |
print(a.ndim) | |
#[Output]: | |
#2 | |
print(a.shape) | |
#[Output]: | |
#(4, 3) | |
print(a.size) | |
#[Output]: | |
#12 | |
print(a.dtype) | |
#[Output]: | |
#int32 | |
print(a.data) | |
#[Output]: | |
#<memory at 0x074C8738> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment