iblrig.raw_data_loaders.bpod_session_data_to_dataframe

iblrig.raw_data_loaders.bpod_session_data_to_dataframe(bpod_data, existing_data=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.

  • existing_data (pd.DataFrame) – Existing dataframe that the incoming data will be appended to.

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: