iblrig.raw_data_loaders.bpod_trial_data_to_dataframe

iblrig.raw_data_loaders.bpod_trial_data_to_dataframe(bpod_trial_data, trial)[source]

Convert a single Bpod trial’s data into a Pandas DataFrame.

Parameters:
  • bpod_trial_data (dict) – A dictionary containing data for a single trial, including timestamps and events.

  • trial (int) – An integer representing the trial index.

Returns:

A Pandas DataFrame containing event data from the specified trial, 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: