Created
January 9, 2020 11:01
-
-
Save elmaedesistemas/4bf57cf519f886a00184be690a586374 to your computer and use it in GitHub Desktop.
Introduction Python Numpy - Arrays
This file contains hidden or 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
#Python Numpy - Arrays | |
import numpy as np | |
numbers = [1,2,3,4] | |
array = np.array(numbers) | |
array | |
np.arange(0,50) | |
np.arange(0,50,5) | |
np.zeros(5) | |
np.ones(5) | |
np.ones((3,3)) | |
np.linspace(0,40,10) | |
np.random.randint(0,100) | |
array = np.random.randint(0,100,10) | |
array | |
array.max() | |
array.argmax() | |
array.reshape(5,2) | |
array | |
array = array.reshape(5,2) | |
array | |
array[4,1] | |
filter = array > 30 | |
array2 = array[filter] | |
array2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment