import numpy as np
arr = np.array([1, 2, 1, 2, 3, 4, 5, 4, 6, 7])
arr = np.unique(arr)
print(arr)
arr1 = np.array([1, 2, 3, 4])
arr2 = np.array([3, 4, 5, 6])
arr = np.union1d(arr1, arr2)
print(arr)
arr1 = np.array([1, 2, 3, 4])
arr2 = np.array([3, 4, 5, 6])
arr = np.intersect1d(arr1, arr2, assume_unique=True)
print(arr)
arr1 = np.array([1, 2, 3, 4])
arr2 = np.array([3, 4, 5, 6])
arr = np.setdiff1d(arr1, arr2, assume_unique=True)
print(arr)
arr1 = np.array([1, 2, 3, 4])
arr2 = np.array([3, 4, 5, 6])
arr = np.setxor1d(arr1, arr2, assume_unique=True)
print(arr)
import numpy as np
arr = np.arange(12).reshape(3, 4)
print("arr :
", arr)
print("Shape : ", arr.shape)
a = np.delete(arr, 1, 0)
'''
[[ 0 1 2 3]
[ 4 5 6 7] -> deleted
[ 8 9 10 11]]
'''
print("
deleteing arr 2 times :
", a)
print("Shape : ", a.shape)
a = np.delete(arr, 1, 1)
'''
[[ 0 1* 2 3]
[ 4 5* 6 7]
[ 8 9* 10 11]]
^
Deletion
'''
print("
deleteing arr 2 times :
", a)
print("Shape : ", a.shape)