array_correspondence
array_correspondence(A, B, axis=None)
Computes a map from A to the equal elements in B
Parameters:
Name | Type | Description | Default |
---|---|---|---|
A |
(a,) or (a,k) numpy array (must be 1-dim or 2-dim)
|
required | |
B |
(b,) or (b,k) numpy array (must be 1-dim or 2-dim)
|
required | |
axis |
int or None, optional (default None)
|
If None, will treat A and B as flat arrays. If a number, will check for equality of the entire axis, in which case the dimension of A and B across that axis must be equal. |
None
|
Returns:
Name | Type | Description |
---|---|---|
f |
(a,) numpy int array
|
index list mapping from A to B, with -1 if there is no
matching entry.
If b contains multiple eligible entries, return an arbitrary one.
If there are no -1s, |
Examples:
TODO
Source code in src/gpytoolbox/array_correspondence.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|