Data Extraction Module Document

This module receives event stream data and extracts information required.

OpenLA.data_extraction.select_user(data, user_id)[source]

Extract the log data of the selected user.

If the argument “user_id” is given as a list, the function extracts all users in the list.

Parameters
Returns

Extracted result.

Return type

The same type with input.

OpenLA.data_extraction.select_contents(data, contents_id)[source]

Extract the log data of the selected contents.

If the argument “contents_id” is given as a list, the function extracts all contents in the list.

Parameters
Returns

Extracted result.

Return type

The same type with input.

OpenLA.data_extraction.select_operation(event_stream, operation_name)[source]

Extract the event stream of the selected operation.

If the argument “operation_name” is given as a list, the function extracts all operation names in the list.

Parameters
  • event_stream (EventStream) – EventStream instance

  • operation_name (str or list[str]) – An operation name or list of operation names

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_marker_type(event_stream, marker_type)[source]

Extract the event stream of the selected type of marker operation.

If the argument “marker_type” is given as a list, the function extracts all marker types in the list.

Parameters
  • event_stream (EventStream) – EventStream instance

  • marker_type (str or list[str]) – A marker type or list of marker types

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_device(event_stream, device_name)[source]

Extract the event stream recorded by the selected device.

If the argument “device_name” is given as a list, the function extracts all device names in the list.

Parameters
  • event_stream (EventStream) – EventStream instance

  • device_name (str or list[str]) – A device name or list of davice names

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_page(event_stream, bottom=None, top=None)[source]

Extract the event stream recorded in the page between “bottom” number and “top” number.

If the argument “bottom” is None, extract all pages under the “top”.

If the argument “top” is None, extract all pages above the “bottom”.

Parameters
  • event_stream (EventStream) – EventStream instance

  • bottom (int or None) – The bottom number of page for extraction

  • top (int or None) – The top number of page for extraction

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_memo_length(event_stream, bottom=None, top=None)[source]

Extract the event stream of memo (note) operation with the length between bottom number and top number.

If the argument “bottom” is None, extract all memo length under the “top”.

If the argument “top” is None, extract all memo length above the “bottom”.

Parameters
  • event_stream (EventStream) – EventStream instance

  • bottom (int or None) – The bottom length of memo for extraction

  • top (int or None) – The top length of memo for extraction

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_time(event_stream, start_time=None, end_time=None)[source]

Extract the event stream recorded between “start_time” and “end_time”.

If the argument “start_time” is None, extract all event stream before “end_time”.

If the argument “end_time” is None, extract all event stream after “start_time”.

Parameters
  • event_stream (EventStream) – EventStream instance

  • start_time (pandas.Timestamp or datetime.datetime or None) – The start time of event stream for extraction

  • end_time (pandas.Timestamp or datetime.datetime or None) – The end time of event stream for extraction

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.select_by_lecture_time(course_info, event_stream, lecture_week, timing='during', extension_minutes_before_lecture=0, extension_minutes_after_lecture=0, include_other_lecture_time=False)[source]

Extract the event stream recorded after, before, or during lecture.

Parameters
  • course_info (CourseInformation) – CourseInformation instance. (See course_information module to know about class CourseInformation)

  • event_stream (EventStream) – EventStream instance

  • lecture_week (int) – a lecture week to extract event stream.

  • timing (str) – The timing to extract the event stream. Choose from “after”, “before”, or “during”.

  • extension_minutes_before_lecture (int) – If you want to include some minutes before the lecture started into the lecture time, use this argument. If you do not want to include some minutes after the lecture started into the lecture time, negative value can be used.

  • extension_minutes_after_lecture (int) – If you want to include some minutes after the lecture ended into the lecture time, use this argument. If you do not want to include some minutes before lecture ended into the lecture time, nagative calue can be used.

  • include_other_lecture_time – If this argument is False, the extracted result does not include the lecture time except for selected lecture week. For example, in the case of ‘lecture_week=2’, ‘timing=before’, and ‘include_other_lecture_time=False’, the extracted result is the event stream from the end of lecture 1 to the begin of lecture 2. If this argument is True and the argument ‘timing’ is ‘before’ or ‘after’, the extracted result include the lecture time before/after selected lecture week. For example, in the case of ‘lecture_week=2’, ‘timing=before’, and ‘include_other_lecture_time=True’, the extracted result is the event stream from the first log of the stream to the begin of lecture 2.

Returns

Extracted result.

Return type

EventStream

OpenLA.data_extraction.concat_data(data_list)[source]

Concatenate multiple data belonging to same class in EventStream, OperationCount, PageWiseAggregation, PageTransition, or TimeRangeAggregation

Parameters

data_list (list[EventStream], list[OperationCount], list[PageWiseAggregation], list[PageTransition], or list[TimeRangeAggregation]) – List of data to concatenate

Returns

The concatenated instance.