how to convert array of arrays into single array with unique values in numpy
>>> array = np.zeros((10,12,42,53))
>>> list(set(array.flat))
[0.0]
how to convert array of arrays into single array with unique values in numpy
>>> array = np.zeros((10,12,42,53))
>>> list(set(array.flat))
[0.0]
how to convert array of arrays into single array with unique values in numpy
set(array.flat)
how to convert array of arrays into single array with unique values in numpy
>>> array = np.zeros((10,12),dtype=int)
>>> print array
[[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0]]
>>> np.unique(array)
array([0])
>>> array[0,5] = 1
>>> array[4,10] = 42
>>> np.unique(array)
array([ 0, 1, 42])
how to convert array of arrays into single array with unique values in numpy
list(set(array.flat))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us