Removing Duplicate Entries from Arrays in Numpy and MATLAB