Skip to content

Instantly share code, notes, and snippets.

@Robofied
Created February 14, 2019 16:19
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/336c62187ae94501252c41f188fb8b77 to your computer and use it in GitHub Desktop.
Save Robofied/336c62187ae94501252c41f188fb8b77 to your computer and use it in GitHub Desktop.
Numpy
## importing numpy for creating numpy array.
import numpy as np
## Creating a normal integer array.
x = np.int_([1,2,4])
## Printing the created array.
x
#[Output]:
#array([1, 2, 4])
## Creating an array with value type float.
y = np.float32(np.zeros((2,3)))
## Printing the value of y.
## It is also showing the dtype(data type) as float.
y
#[Ouput]:
#array([[0., 0., 0.],
# [0., 0., 0.]], dtype=float32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment