Skip to content

Commit

Permalink
Merge pull request #868 from SimonLafran/fix-addinfo-indexing
Browse files Browse the repository at this point in the history
[FIX] KeyError in _eventrelated_addinfo
  • Loading branch information
DominiqueMakowski authored Jul 17, 2023
2 parents 1c1651d + ac08ef3 commit a802b57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neurokit2/epochs/eventrelated_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _eventrelated_sanitizeinput(epochs, what="ecg", silent=False):
def _eventrelated_addinfo(epoch, output={}):
# Add label
if "Index" in epoch.columns:
output["Event_Onset"] = epoch.loc[np.min(np.abs(epoch.index))]["Index"]
output["Event_Onset"] = epoch.iloc[np.argmin(np.abs(epoch.index))]["Index"]

# Add label
if "Label" in epoch.columns and len(set(epoch["Label"])) == 1:
Expand Down

0 comments on commit a802b57

Please sign in to comment.