Skip to content

Commit

Permalink
added video time to NaN check as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomahawkuru committed Jul 15, 2021
1 parent 51600c4 commit fc7f16e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

def file_reader(path, participant, trial, filename):
# read data file
path = path + str(participant) + "/" + str(trial) + "/"
file = [i for i in os.listdir(path) if os.path.isfile(os.path.join(path, i)) and \
filename in i]
csvdata = pandas.read_csv(path + file[0], delimiter=',')

# remove last row (can be partially logged) and replace nan values
csvdata.drop(csvdata.tail(1).index,inplace=True)
csvdata.dropna(subset=["Time"], inplace=True)
csvdata.dropna(subset=["raw_timestamp"], inplace=True)
if 'relative_to_video_first_frame_timestamp' in csvdata.columns:
csvdata.dropna(subset=["relative_to_video_first_frame_timestamp"], inplace=True)
csvdata = csvdata.fillna(0)

# interpolate missing gaps in the data that represent Blinks (for Varjo Base recordings)
Expand Down

0 comments on commit fc7f16e

Please sign in to comment.