lenskit.data.MutableItemListCollection#
- class lenskit.data.MutableItemListCollection(key, *, index=True)#
Bases:
ItemListCollector
,ItemListCollection
[K
],Generic
[K
]Intersection type of
ItemListCollection
andItemListCollector
.- __init__(*args, **kwargs)#
Methods
__init__
(*args, **kwargs)add
(list, *fields, **kwfields)Add a single item list to this list.
add_from
(other, **fields)Add all collection from another collection to this collection.
empty
(key, *[, index])Create a new empty, mutable item list collection.
from_df
(df, key, *others)Create an item list collection from a data frame.
from_dict
(data[, key])Create an item list collection from a dictionary.
items
()Iterate over item lists and keys.
keys
()Iterate over keys.
lists
()Iterate over item lists without keys.
load_parquet
(path[, key, layout])Load this item list from a Parquet file.
lookup
(*args, **kwargs)Look up a list by key.
lookup_projected
(key)Look up an item list using a projected key.
record_batches
([batch_size, columns])Get the item list collection as Arrow record batches (in native layout).
save_parquet
(path, *[, layout, batch_size, ...])Save this item list collection to a Parquet file.
to_arrow
(*[, batch_size])Convert this item list collection to an Arrow table.
to_df
()Convert this item list collection to a data frame.
Attributes
key_fields
The names of the key fields.
key_type
The type of collection keys.
list_schema
Get the schema for the lists in this ILC.