Event Stream Document¶
- class OpenLA.data_classes.event_stream.EventStream(df)[source]¶
Bases:
object
- property df¶
- num_users()[source]¶
Get the number of users in the event stream
- Returns
The number of users in the event stream
- Return type
int
- user_id()[source]¶
Get the unique user ids in the event stream
- Returns
One-dimensional array of user ids in the event_stream
- Return type
List[str]
- contents_id()[source]¶
Get the unique contents ids in the event stream
- Returns
One-dimensional array of contents ids in the event stream
- Return type
List[str]
- operation_name()[source]¶
Get the unique operations in event stream
- Returns
One-dimensional array of operation names in the event stream
- Return type
List[str]
- marker_type()[source]¶
Get the unique marker types in the event stream
- Returns
One-dimensional array of marker-types in the event stream
- Return type
List[str]
- device_code()[source]¶
Get the unique device codes in the event stream
- Returns
One-dimensional array of device-code in the event stream
- Return type
List[str]
- operation_count(operation_name=None, user_id=None, contents_id=None, separate_marker_type=False)[source]¶
Get the count of each operation in event stream
- Parameters
user_id (str or None) – The user to count operation
contents_id (str, List[str], or None) – The contents to count operation
operation_name (str or None) – The name of operation to count
separate_marker_type (bool) – whether to count ‘MARKER’ operations by separating the type “difficult” or “important”
- Returns
If “operation_name” is None, return dictionary of the number of each operation in event stream. (Key: operation name, Value: The count of the operation)
else if “operation_name” is indicated, return the count of the operation
- Return type
dict or int