Skip to content

Instantly share code, notes, and snippets.

@Robofied
Created February 14, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Robofied/9574695d937ca99b9842c1b017191740 to your computer and use it in GitHub Desktop.
Save Robofied/9574695d937ca99b9842c1b017191740 to your computer and use it in GitHub Desktop.
Numpy
import numpy as np
a = np.array([1.,2.,3.])
print(a.shape)
b = np.array([[1.,2.,3.]])
print(b.shape)
#[output]:
#(3,)
#(1, 3)
#dtype-> It will let you know about the data type of stored values in the array.
print(a.dtype)
#[Output]:
#float64
#type-> It will return the type of object associated with the variable
print(type(a))
#[Output]:
#<class 'numpy.ndarray'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment