Created
February 14, 2019 16:19
-
-
Save Robofied/336c62187ae94501252c41f188fb8b77 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
## 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