Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if numpy array contains only duplicates

# Check all values in an array are equal to its first element
result = np.all(arr == arr[0])
if result:
    print('All values in the array are the same / equal')
else:
    print('All values in the array are not the same')
Source by thispointer.com #
 
PREVIOUS NEXT
Tagged: #check #numpy #array #duplicates
ADD COMMENT
Topic
Name
7+2 =