Gradebook Worksheet
The Story So Far
Your technical expertise and gradebook wizardry has led the committee to make a surprising decision - in addition to teaching a full courseload, investigating wizardly mysteries, and helping oversee a quarter of the student body during non-class hours, you are now in charge of creating the new LMS gradebook. Like many schools with more confidence than sense, we're rolling our own.
Part 1
Today's part of the process is getting data in and out of a database, using Python.
In total, you will write:
- A function which reads in a file formatted like
students.csv
and adds it to your student table.
You can do this with thecsv
module, but read the docs ofpandas.DataFrame.to_sql()
for a faster method for converting large tables.
(SQLite itself can actually directly read in csv as well, but it is not part of the Python interface.) - A function which writes a file (taking the target file as a parameter) formatted like
students.csv
. Row and column order do not matter, but make sure you have a header. - A function which reads in a gradebook in the format of the given class files, and inserts its (non-computed) values into your tables.
- A function which reads out a gradebook in the format of the given class files, computing the grade as discussed previously (30%,30%,40%). Round to one decimal place.
Part 2
On Monday, we are going to talk about statistical functions in SQL, command line operation of Python, and extend our Python gradebook manipulator.