-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
Python APIIssue is about the Python APIIssue is about the Python APIenhancementNew feature or requestNew feature or request
Milestone
Description
A common thing people - at least with SLiM tree sequences - want to do is "get a vector of values from metadata where every object has the thing in metadata", e.g.
np.array([ind.metadata['slim_time'] for ind in ts.individuals()])
We do in pyslim, and @bodkan does this also (somewhat painfully?) in slendr using reticulate. The list comprehension is pretty easy to do, but to make it easier, perhaps there's an API we could make up? like
ts.metadata_vector('individuals', 'slim_time')
for instance? Perhaps with an optional default
argument that provides the value to be used when the key is not present in a metadata?
Metadata
Metadata
Assignees
Labels
Python APIIssue is about the Python APIIssue is about the Python APIenhancementNew feature or requestNew feature or request