sort

method of dascore.core.spool.BaseSpool source

sort(
    self ,
    attribute ,
)-> ‘Self’

Sort the Spool based on a specific attribute.

Parameters

Parameter Description
attribute The attribute or coordinate used for sorting. If a coordinate name
is used, the sorting will be based on the minimum value.

Examples

import dascore as dc
spool = dc.get_example_spool()
# sort spool based on values in time coordinate.
spool_time_sorted = spool.sort("time")
# sort spool based on values in tag
spool_tag_sorted = spool.sort("tag")