This provides useful general functions for working with lists
(OBSOLETE).
This module and its C code equivalent are considered to be obsolete,
and are likely to be deprecated in a future release of Biopython, before
being removed. Please get in touch via the mailing list if this will
affect you. Many of these functions can be avoided using the python set
object.
Functions: asdict Make the list into a dictionary (for fast
testing of membership). items Get one of each item in a list.
count Count the number of times each item appears. contents
Calculate percentage each item appears in a list. itemindex Make an
index of the items in the list. intersection Get the items in common
between 2 lists. difference Get the items in 1 list, but not the
other. indexesof Get a list of the indexes of some items in a list.
take Take some items from a list.
dictionary
|
asdict(l)
Return a dictionary where the keys are the items in the list, with
arbitrary values. |
source code
|
|
list of items
|
|
dict of counts of each item
|
count(items)
Count the number of times each item appears in a list of data. |
source code
|
|
dict of item:percentage
|
contents(items)
Summarize the contents of the list in terms of the percentages of
each item. |
source code
|
|
list of common items
|
|
list of items in l1, but not l2
|
|
dict of item : index of item
|
|
list of indexes
|
indexesof(l,
fn)
Return a list of indexes i where fn(l[i]) is true. |
source code
|
|
list of just the indexes from l
|
|
|
|