mask = range(5)

a = np.array(a)

a[mask]

"""
Explanation: <h3> Exploring the function of mask how we can put a list inside numpy array </h3>
End of explanation
"""


b = np.array([[1,2,3,4],[5,6,7,8]])

b

b[1,2]

b[1]

b[1,:]

b[:]

b[:,1]

b = np.array([1,2,3,4])

np.dot(b,b)

c = np.array([[1,2,3,4],[5,6,7,8]])

c

a = np.array([4,5,6,7])

c - a

a * a

a.sum(axis = 0)

a

c

c.sum(axis = 0)

c.sum(axis = 1)

"""
Explanation: <h3> Exploring 2d array </h3>
End of explanation
"""


train = np.array([[1,2,3,4],[5,6,7,8],[3,1,9,8]])

test = np.array([[1,2,3,4],[5,6,7,8],[1,1,1,1],[3,2,1,6]])

test.shape

train.shape

#and we have to make a vectorized operation so that 
#we can get 4 * 3 vector based on euclidean.Vectorized 
train.reshape(3,1,4)

test.shape

a = train.reshape(3,1,4) - test

a.shape

b = a.sum(axis = 2)

b.shape

b

a

a*a

(a*a).sum(axis = 2)

b

b.sum(axis = 1)

p = np.array([1,2,1,2,3,1,4,23])

np.bincount(p)

p.argmax()

#Array split

a = np.array(range(100))

p =np.array_split(a,6)

p

p

np.hstack(p[:2]+p[4:])

np.vstack(p[:2])

a = np.array([[1,2,3,4],[4,5,6,7]])

(a**2).sum(axis = 1)

b

b.sum(axis = 0)

b[0]

b[0,:]

a 

np.square(b[0] - a).sum(axis = 1)

a = np.array([[1,2,3,4,5],[6,6,7,8,8],[7,7,7,8,1]])

a

a[np.arange(3),[1,2,3]].reshape(3,1)

np.maximum(a,a)

a = np.arange(100).reshape(5,20)

a

b = np.random.choice(89)

b

a[1:3]

a

np.argmax(a,axis = 1)

p = [1,2,3,4]
q = [5,6,7,8]
zip(p,q)

a = np.array([1,2,3,4])

a.sum()

relu = lambda x : x*(x > 0)

relu(5)

relu(0)

relu(-1)

np.logspace(2,3,5)

np.linspace(1,2,10)

"""
Explanation: <h3> Finding the L2 or euclidean distance based on test and train data </h3>
End of explanation
"""


