Skip to content

Instantly share code, notes, and snippets.

View Jorundur's full-sized avatar

Jörundur Jörundsson Jorundur

View GitHub Profile
@Jorundur
Jorundur / .slate
Created October 2, 2017 21:14
Basic Slate config file
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Key bindings
bind esc:cmd hint
# Focus Bindings
bind right:cmd focus right
bind left:cmd focus left
@Jorundur
Jorundur / ChangeTable.md
Last active April 4, 2023 20:57
Restructuring an Excel table with Python 3

Restructuring an Excel table with Python 3

Warning: Includes some dodgy code... can definitely be improved! I was asked for help restructuring a huge Excel table and this was the result.

Problem:

We had an Excel table of the format shown in the Input Table. It could have any number of experiments, subjects and trials (unique values under ExperimentsName, Subject and Trial columns) in addition to any number of score IDs (ScoreX columns). In the example below there are 3 experiments, 3 subjects, 4 trials and N score columns. This needed to be transformed into a table similar to the Output Table, where each row represents one subject.

Input Table:

| ExperimentName | Subject | Trial | Score1 | Score2 | Score3 | Score4 | ... | ScoreN |