"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "numpy/lib/arraysetops.py" between
numpy-1.21.0.tar.gz and numpy-1.21.1.tar.gz

About: NumPy is the fundamental package for scientific computing with Python.

arraysetops.py  (numpy-1.21.0):arraysetops.py  (numpy-1.21.1)
skipping to change at line 334 skipping to change at line 334
else: else:
ar.sort() ar.sort()
aux = ar aux = ar
mask = np.empty(aux.shape, dtype=np.bool_) mask = np.empty(aux.shape, dtype=np.bool_)
mask[:1] = True mask[:1] = True
if aux.shape[0] > 0 and aux.dtype.kind in "cfmM" and np.isnan(aux[-1]): if aux.shape[0] > 0 and aux.dtype.kind in "cfmM" and np.isnan(aux[-1]):
if aux.dtype.kind == "c": # for complex all NaNs are considered equival ent if aux.dtype.kind == "c": # for complex all NaNs are considered equival ent
aux_firstnan = np.searchsorted(np.isnan(aux), True, side='left') aux_firstnan = np.searchsorted(np.isnan(aux), True, side='left')
else: else:
aux_firstnan = np.searchsorted(aux, aux[-1], side='left') aux_firstnan = np.searchsorted(aux, aux[-1], side='left')
mask[1:aux_firstnan] = (aux[1:aux_firstnan] != aux[:aux_firstnan - 1]) if aux_firstnan > 0:
mask[1:aux_firstnan] = (
aux[1:aux_firstnan] != aux[:aux_firstnan - 1])
mask[aux_firstnan] = True mask[aux_firstnan] = True
mask[aux_firstnan + 1:] = False mask[aux_firstnan + 1:] = False
else: else:
mask[1:] = aux[1:] != aux[:-1] mask[1:] = aux[1:] != aux[:-1]
ret = (aux[mask],) ret = (aux[mask],)
if return_index: if return_index:
ret += (perm[mask],) ret += (perm[mask],)
if return_inverse: if return_inverse:
imask = np.cumsum(mask) - 1 imask = np.cumsum(mask) - 1
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)