For a bit of in-class python coding, we'll fill out a Python script to read in a comma-delimited file, and calculate, for each column:
- Number of non-missing values
- Mean
- Median
- SD
Here are the relevant files:
data.csv
— the data file to considerstats.py
— the script to be filled instats2.py
— partly-filled version: just fill in the functions to calculate the statisticstest_stats.py
— unit tests for functions instats.py
Also relevant:
create_example_data.py
— the Python script I wrote to generate thedata.csv
file.solns_DONT_PEEK.py
— my solutions (don't look at this until later)