• enumerate()

    I was hoping to regularly update, but revisions and data collection have gotten in the way (not a bad problem to have). This is just a short shout-out to the wonderful enumerate() function in Python3. It adds indexing to iteration. So, instead of: You can do: Granted, that's a pretty simple case, and you don't gain much. However, I've been working on rescoring/relabeling trigger codes in EEG timing files. The files are ~500 lines of text. Each event has an index, timestamp, description, type, and duration. Those five values are separated by commas, so my solution was to create a list of lists (the header lines in the timing file…