'''

Overview of major numpy functions

'''

import numpy as np


#create list and convert to array
lst = [1,2,3,4]
arr = np.array(lst)

# Create ARRAY 0-9.5 in step sizes of 0.5
a = np.arange(0, 10, 0.5)

# create 2d array of ZEROS, row x column
b = np.zeros((5,5))

# create 2d array of ONES, row x column
c = np.ones((2,4))

# Create RANDOM  integer between 0 and 100
d = np.random.randint(0, 100)

# Create array of random integers
e = np.random.randint(0,100,(5,5)) 

# Create LINEARLY spaced array from 0 to 10 with 6 numbers
f = np.linspace(0, 10, 100)

# Set seed in random number generator so we get consistent random numbers
np.random.seed(101)
g = np.random.randint(0,100,10)

# Find max of array
test = np.random.randint(0,100,10)
max_test = test.max()
min_test = test.min()
mean_test = test.mean()

# Return index location of max/min
max_index = test.argmax()
min_index = test.argmin()

# Indexes in array
arr1 = np.arange(0,100).reshape(10,10) # create 10x10 array
print(arr1[5,2]) #print a single value
print(arr1[:,1]) #print all values from a column
print(arr1[5,:]) #print all values from a row

# Masking
print(arr1>40) #return matrix of boolean True/False







