selection from a DataSeries
removal from a DataSeries
selection and removal from a DataSeries
select(f, DS, b1, ..., bn)
select[inplace](f, DS, b1, ..., bn)
remove(f, DS, b1, ..., bn)
remove[inplace](f, DS, b1, ..., bn)
selectremove(f, DS, b1, ..., bn)
selectremove[inplace](f, DS, b1, ..., bn)
a DataSeries object
b1, ..., bn
(optional) extra arguments for f
When called on a DataSeries object, the select command returns a DataSeries object consisting of those entries that satisfy the given criterion.
When called on a DataSeries object, the remove command returns a DataSeries object consisting of those entries that do not satisfy the given criterion.
When called on a DataSeries object, the selectremove command returns a sequence of two DataSeries objects, the first consisting of those entries that satisfy the given criterion and the second consisting of those entries that don't satisfy the given criterion.
The commands can also be called on other types of arguments. This behavior is described on the main help page for select.
The criterion used for deciding whether an entry x of the DataSeries is included in the result is to call f⁡x,b1,...,bn. This should return true or false (or FAIL, which is interpreted in the same way as false). If you call select, then the returned DataSeries will contain x if and only if the value returned is true. If you call remove, then the returned DataSeries will contain x if and only if the value returned is false (or FAIL).
Any entry that is included in the result will have the same label that it has in DS.
If you call select[inplace] or remove[inplace], the command will modify the DataSeries object DS and return it. The calling sequences with no index on the command name will return a new DataSeries object and leave DS unchanged. If you call selectremove[inplace], then the command will modify DS to be the first DataSeries returned, and the second DataSeries will be a new DataSeries object.
You can do similar things with DataSeries indexing using a Boolean DataSeries. See the examples below.
We split ds, below, into prime and non-prime entries in various ways, using the isprime command as the testing criterion.
ds ≔ DataSeries⁡5,6,7,8,9,labels=a,b,c,d,e
The same results can be obtained using indexing with a Boolean DataSeries.
If we want to select the entries of a particular type, then we can use the optional third argument to select.
The original DataSeries, ds, is unchanged, because we used the commands without the inplace index.
If we call select with the inplace index, then ds is modified in-place.
The DataSeries/select, DataSeries/remove and DataSeries/selectremove commands were introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
main help page for select
Download Help Document