lookup
- lookup(indexer, values)
Build an output fieldset using the values in
indexeras indices for a look-up invalues.- Parameters
index – indexer fieldset
values (
Fieldsetor 1D-ndarray) – values to choose from
- Return type
lookup()takes the grid values inindexerand uses them as index invaluesin the following way:let us suppose a grid value in the i-th
indexerfield is N (for float values the integer part is taken)what happens depends on the type of
values:if
valuesis aFieldsetthe value at the same gridpoint in the (N-1)-th field invaluesis written into the i-th output field at the given gridpoint (here field indexing starts at 0)if
valuesis an ndarray the value at the (N-1)-th position in thevaluesarray is written into the i-th output field at the given gridpoint
The output will have has as many fields as there are in
indexer.Any missing values in
indexerwill cause the function to fail with a “value out of range” error message.