@@ -412,9 +412,40 @@ def kron(a: Array, b: Array, /, *, xp: ModuleType) -> Array:
412412def setdiff1d (
413413 x1 : Array , x2 : Array , / , * , assume_unique : bool = False , xp : ModuleType
414414) -> Array :
415- """Find the set difference of two arrays.
415+ """
416+ Find the set difference of two arrays.
416417
417418 Return the unique values in `x1` that are not in `x2`.
419+
420+ Parameters
421+ ----------
422+ x1 : array
423+ Input array.
424+ x2 : array
425+ Input comparison array.
426+ assume_unique : bool
427+ If ``True``, the input arrays are both assumed to be unique, which
428+ can speed up the calculation. Default is ``False``.
429+ xp : array_namespace
430+ The standard-compatible namespace for `x1` and `x2`.
431+
432+ Returns
433+ -------
434+ res : array
435+ 1D array of values in `x1` that are not in `x2`. The result
436+ is sorted when `assume_unique` is ``False``, but otherwise only sorted
437+ if the input is sorted.
438+
439+ Examples
440+ --------
441+ >>> import array_api_strict as xp
442+ >>> import array_api_extra as xpx
443+
444+ >>> x1 = xp.asarray([1, 2, 3, 2, 4, 1])
445+ >>> x2 = xp.asarray([3, 4, 5, 6])
446+ >>> xpx.setdiff1d(x1, x2, xp=xp)
447+ Array([1, 2], dtype=array_api_strict.int64)
448+
418449 """
419450
420451 if assume_unique :
0 commit comments