Contoh unik numpy dapatkan baris dan kolom yang unik

# welcome to softhunt.net
import numpy as np

# Creating 2D Array
duplicate_array_2d = np.array([[2,2,1],[4,5,5],[2,5,5]])

print('2D array:\n', duplicate_array_2d)

# GET UNIQUE ROWS
unique_rows  = np.unique(duplicate_array_2d, axis = 0)
print('Unique rows: \n', unique_rows)

# GET UNIQUE COLUMNS
unique_columns  = np.unique(duplicate_array_2d, axis = 1)
print('Unique columns: \n', unique_columns)
Outrageous Ostrich