eelbrain.Datalist
- class eelbrain.Datalist(items=None, name=None, fmt='repr')
list
subclass for including lists in in a Dataset.- Parameters:
items (Sequence[Any]) – Content for the Datalist.
name (str) – Name of the Datalist.
fmt ('repr' | 'str' | 'strlist') – How to format items when converting Datasets to tables (default ‘repr’ uses the normal object representation).
Notes
Modifications:
adds certain methods that makes indexing behavior more similar to numpy and other data objects
blocks methods for in place modifications that would change the lists’s length
Examples
Concise string representation:
>>> l = [['a', 'b'], [], ['a']] >>> print(Datalist(l)) [['a', 'b'], [], ['a']] >>> print(Datalist(l, fmt='strlist')) [[a, b], [], [a]]
Methods
|
Summarize cases for each cell in x |
|
Append object to the end of the list. |
|
Remove all items from list. |
|
Return a shallow copy of the list. |
|
Return number of occurrences of value. |
|
Extend list by appending elements from the iterable. |
|
Return first index of value. |
|
Insert object before index. |
|
Remove and return item at index (default last). |
|
Remove first occurrence of value. |
|
Reverse IN PLACE. |
|
Sort the list in ascending order and return None. |