iblrig.raw_data_loaders.bpod_session_data_to_dataframe

iblrig.raw_data_loaders.bpod_session_data_to_dataframe(bpod_data, trials=None)[source]

Convert Bpod session data into a single Pandas DataFrame.

Parameters:
  • bpod_data (list of dict) – A list of dictionaries as returned by load_task_jsonable, where each dictionary contains data for a single trial.

  • trials (int, list of int, slice, or None, optional) – Specifies which trials to include in the DataFrame. All trials are included by default.

Returns:

A Pandas DataFrame containing event data from the specified trials, with the following columns:

  • Timedatetime.timedelta

    timestamp of the event (datetime.timedelta)

  • Typestr (categorical)

    type of the event (TrialStart, StateStart, InputEvent, etc.)

  • Trialint

    index of the trial, zero-based

  • Statestr (categorical)

    name of the state

  • Eventstr (categorical)

    name of the event (only for type InputEvent)

  • Channelstr (categorical)

    name of the event’s channel (only for a subset of InputEvents)

  • Valueint

    value of the event (only for a subset of InputEvents)

Return type:

pd.DataFrame

Parameters: