Time-range Aggregation Document¶
- class OpenLA.data_classes.time_range_aggregation.TimeRangeAggregation(df)[source]¶
Bases:
object
- property df¶
- num_users()[source]¶
Get the number of users in the Dataframe
- Returns
The number of users in the Dataframe
- Return type
int
- user_id()[source]¶
Get the unique user ids in the Dataframe
- 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 Dataframe
- Returns
One-dimensional array of contents ids in the Dataframe
- Return type
List[str]
- operation_name()[source]¶
Get the unique operations in the Dataframe
- Returns
One-dimensional array of operation names in the Dataframe
- Return type
List[str]
- operation_count(operation_name=None, user_id=None, contents_id=None)[source]¶
Get the count of each operations in the Dataframe
- Parameters
user_id (str or None) – The user to count operation. If it is None, the total count of all users is returned.
contents_id (str or None) – The contents to count operation. If it is None, the total count in all contents is returned.
operation_name (str or None) – The name of operation to count
- Returns
If “operation_name” is None, return dictionary of the number of each operation in the Dataframe. (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