Solution
import numpy as np
Arr1 = np.empty([4,2], dtype = np.uint16)
print(Arr1)
print("Shape : ", Arr1.shape)
print("Dimensions ", Arr1.ndim)
print("Element Length (bytes) : ", Arr1.itemsize)
import numpy as np
ndArray = np.arange(500, 320, 10)
ndArray = ndArray.reshape(5,2)
print (ndArray)
import numpy as np
DzoneArray = np.array([[10 ,20, 30], [40, 50, 60], [70, 80, 90]])
print("Array :")
print(DzoneArray)
print("\n All data in second column ")
newArray = DzoneArray[...,1]
print(newArray)
import numpy as np
TestArray = np.array([[4 ,8, 33, 29], [20 ,41, 28, 12],
[36 ,18, 44, 37], [52 ,56, 19, 64], [68 ,50, 76, 80]])
print("Org. :")
print(TestArray)
print("\n narray of odd rows and even columns")
newArray = TestArray[::2, 1::2]
print(newArray)
import numpy
arr1 = numpy.array([[5, 8, 6], [21 ,20, 27]])
arr2 = numpy.array([[15 ,33, 24], [4 ,5, 1]])
resultArray = arr1 + ar2
print("addition of arrays is \n")
print(resultArray)
for num in numpy.nditer(resultArray, op_flags = ['readwrite']):
num[...] = num*num
print("\n After square \n")
print(resultArray)
import numpy
print("9X3 numpy array")
Arr1 = numpy.arange(10, 37, 1)
Arr1 = Arr1.reshape(9,3)
print (Arr1)
print("\n Spliting into 3 sub array\n")
subArrays = numpy.split(Arr1, 3)
print(subArrays)
import numpy
print("Original array")
Arr1 = numpy.array([[11,43,49],[82,50,12],[53,23,77]])
print (Arr1)
sortByRow = Arr1[:,Arr1[1,:].argsort()]
print("Sorting by second row")
print(sortByRow)
print("Sorting by second column")
sortByCol = Arr1[ndArray[:,1].argsort()]
print(sortByCol)
import numpy
print("Org:")
ndArray = numpy.array([[11,43,49],[82,50,12],[53,23,77]])
print (dzoneArray)
min_Axis1 = numpy.amin(dzoneArray, 1)
print("min Of Axis 1")
print(min_Axis1)
max_Axis1 = numpy.amax(dzoneArray, 0)
print("max Of Axis 0")
print(max_Axis1)
import numpy
print("Org:")
Arr1 = numpy.array([[11,43,49],[82,50,12],[53,23,77]])
print (Arr1)
print("After deleting col 2 on axis 1")
Arr1 = numpy.delete(Arr1 , 1, axis = 1)
print (Arr1)
arr = numpy.array([[10,10,10]])
print("after inserting col 2 on axis 1")
Arr1 = numpy.insert(ndArray , 1, arr, axis = 1)
print (ndArray)
import numpy
x = np.array([11,6,15,8,3,6])
y = np.array([11,3,4,5,2,6])
print(np.where(x == y))