<실습>

1 )

arr=np.arange(216) arr=arr.reshape(6,6,6)

1 - 1 )

arr1_1 = [] for i in range(6): tmp=[] for j in range(1,6,2): tmp.append(arr[i][5][j]) arr1_1.append(tmp)

1 - 2 )

arr1_2=[] for i in range(6): for j in range(6): for k in range(6): if arr[i][j][k] % 12 ==0: arr1_2.append(arr[i][j][k])

1 - 3 )

arr1_1 = np.ravel(arr1_1,order="C")

print(list(set(arr1_1) - set(arr1_2)))

2 )

arr = np.arange(2,101)

arr = set(arr) - set(arr[(arr % 2 == 0) & (arr > 2)]) - set(arr[(arr % 3 == 0) & (arr > 3)]) - set(arr[(arr % 5 == 0) & (arr > 5)]) - set(arr[(arr % 7 == 0) & (arr > 7)]) arr=list(arr) print(arr)

<이론>

  1. o 넘파이 배열은 동일한 타입의 값들을 가진다.