Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.setxor1d

numpy.setxor1d(ar1,ar2,assume_unique=False)[source]

Find the set exclusive-or of two arrays.

Return the sorted, unique values that are in only one (not both) of theinput arrays.

Parameters:
ar1, ar2:array_like

Input arrays.

assume_unique:bool

If True, the input arrays are both assumed to be unique, whichcan speed up the calculation. Default is False.

Returns:
setxor1d:ndarray

Sorted 1D array of unique values that are in only one of the inputarrays.

Examples

>>>a=np.array([1,2,3,2,4])>>>b=np.array([2,3,5,7,5])>>>np.setxor1d(a,b)array([1, 4, 5, 7])

Previous topic

numpy.setdiff1d

Next topic

numpy.union1d

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp