Every time your advisor wants the cross-tab run on new data, what do you do?
Open Excel, replace the data, rebuild the pivot, reformat the table. Thirty minutes minimum, and I have to remember which columns map to which.
This week you stop doing that. A function is the formula you write once and call with any input. def compute_crosstab(responses, group_by): names the logic. return result hands it back. Run it on Week 3 data and again on Week 7 data — same function, same output format, different input. Your methodology section becomes reproducible.
And by parsing the CSV text directly in Python, I can feed in any Qualtrics export without touching Excel at all?
Exactly that. Day 17 wraps the cross-tab logic in a documented function with named parameters. Day 18 adds default arguments and tuple returns for when you need multiple values at once. Day 19 parses a CSV-formatted string without any real file I/O — Pyodide runs in-browser and takes the text as an argument. Day 20 does it properly with csv.DictReader. Day 21 serialises the summary to JSON so you can hand it to your advisor or paste it into your paper. By the end your entire analysis reruns on any Qualtrics export with one function call.
make_crosstab_line: function with docstring, named params — wraps the formatting pipelinesummarize_group: default args and tuple return — multiple values, one callparse_survey_csv: reading files — parse a CSV string into response dicts (text passed as argument)load_responses_from_csv: csv.DictReader — the proper parser for Qualtrics exportsresponses_to_json: json.dumps — serialise the summary for sharingGoal: make your entire analysis rerun on any new Qualtrics export with a single function call.
7 lessons this week
Every time your advisor wants the cross-tab run on new data, what do you do?
Open Excel, replace the data, rebuild the pivot, reformat the table. Thirty minutes minimum, and I have to remember which columns map to which.
This week you stop doing that. A function is the formula you write once and call with any input. def compute_crosstab(responses, group_by): names the logic. return result hands it back. Run it on Week 3 data and again on Week 7 data — same function, same output format, different input. Your methodology section becomes reproducible.
And by parsing the CSV text directly in Python, I can feed in any Qualtrics export without touching Excel at all?
Exactly that. Day 17 wraps the cross-tab logic in a documented function with named parameters. Day 18 adds default arguments and tuple returns for when you need multiple values at once. Day 19 parses a CSV-formatted string without any real file I/O — Pyodide runs in-browser and takes the text as an argument. Day 20 does it properly with csv.DictReader. Day 21 serialises the summary to JSON so you can hand it to your advisor or paste it into your paper. By the end your entire analysis reruns on any Qualtrics export with one function call.
make_crosstab_line: function with docstring, named params — wraps the formatting pipelinesummarize_group: default args and tuple return — multiple values, one callparse_survey_csv: reading files — parse a CSV string into response dicts (text passed as argument)load_responses_from_csv: csv.DictReader — the proper parser for Qualtrics exportsresponses_to_json: json.dumps — serialise the summary for sharingGoal: make your entire analysis rerun on any new Qualtrics export with a single function call.