Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #intro_numpy
- import numpy as np
- a1 = np.array([1,2,3])
- print (a1)
- print (type(a1)) #numpy.ndarray
- a2 = np.array([
- [1,2,3],
- [4,5,6],
- [7,8,9]
- ])
- print (a2)
- print (type(a2)) #numpy.darray
- progArit3 = np.arange(
- 1, #min
- 50+1,#max, exclusive
- 3 #step
- )
- print(progArit3)
- #floats
- linSpace12 = np.linspace(
- 1, #min
- 50, #max
- 120 #how many elements
- )
- print (linSpace12)
- #powers of 10
- logSpace1 = np.logspace(
- 2,#start-exponent (start @ base^2)
- 16,#end-exponent (end base^5)
- num=50, #size of col
- base=2
- )
- print (logSpace1)
- print (np.var(linSpace12))
Advertisement
Add Comment
Please, Sign In to add comment