Skip to content

Commit

Permalink
Check for bad omitted stimulus at start of both active and passive bl…
Browse files Browse the repository at this point in the history
…ocks.
  • Loading branch information
morriscb committed Oct 31, 2023
1 parent fe87c87 commit 46b1a60
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,10 +596,18 @@ def _check_for_errant_omitted_stimulus(
found, return input_df unmodified.
"""
if "omitted" in input_df.columns and len(input_df) > 0:
first_row = input_df.iloc[0]
if not pd.isna(first_row["omitted"]):
if first_row["omitted"]:
input_df = input_df.drop(first_row.name, axis=0)
if "stimulus_block" in input_df.columns:
for stim_block in input_df['stimulus_block'].unique():
first_row = input_df[
input_df['stimulus_block'] == stim_block].iloc[0]
if not pd.isna(first_row["omitted"]):
if first_row["omitted"]:
input_df = input_df.drop(first_row.name, axis=0)
else:
first_row = input_df.iloc[0]
if not pd.isna(first_row["omitted"]):
if first_row["omitted"]:
input_df = input_df.drop(first_row.name, axis=0)
return input_df

@staticmethod
Expand Down

0 comments on commit 46b1a60

Please sign in to comment.