INF 385T
    Python - Reading and Writing CSV and SQL from python
    Skip To Content
    Dashboard
    • Login
    • Dashboard
    • Calendar
    • Inbox
    • Help
    Close
    • My Dashboard
    • INF 385T
    • Assignments
    • Python - Reading and Writing CSV and SQL from python
    Fall 2015
    • Home
    • Syllabus
    • Modules
    • Assignments
    • Research Help
    • Zoom
    • Panopto Video
    • My Textbooks

    Python - Reading and Writing CSV and SQL from python

    • Due Nov 2, 2015 by 9am
    • Points 7
    • Submitting a text entry box or a file upload
    • File Types pdf
    • Available after Oct 29, 2015 at 9am

    For these questions upload a PDF with code (ideally with syntax highlighting).

    1. Using python execute query from Q5, 6, and 7 in Queries 3 homework and save the results as CSVs. (3 points, one per query)

    2. Execute those queries and print results out as sentences (using .format() ). That requires reaching into the row dict to identify individual fields. You do not need to transform the results of the query beyond simple formatting, so displaying month number is adequate. (3 points, one per query)

    3. (1 point) Read a CSV and output it as a fixed width file. When viewed using "cat" on the command line, each column should be separated by minimum 2 spaces, the column headers should left align with their content and the headers should be divided from the content with a line made of dashes. Hint: this involves looking at maximum length of items in each column and adding spaces after the item to pad out the column. We will run your code against two different input CSVs (neither you will not see beforehand, one with have 3 columns and the other will have an unknown number of columns).

    This picture shows an example (with 3 columns), get this one working first then try others. The input file is available with:

    cp /home/jhowison/data_wrangling_class_files/7_csv/foundation.csv ~/

    FixedWidthFoundationExample.png

    1446476400 11/02/2015 09:00am
    Additional Comments:
    Rating max score to > pts

    Rubric

     
     
     
     
     
     
     
         
    Can't change a rubric once you've started using it.  
    Find a Rubric
    Find Rubric
    Title
    You've already rated students with this rubric. Any major changes could affect their assessment results.
    Title
    Criteria Ratings Pts
    Edit criterion description Delete criterion row
    This criterion is linked to a Learning Outcome Description of criterion
    threshold: 5 pts
    Edit rating Delete rating
    5 to >0 pts
    Full Marks
    blank
    Edit rating Delete rating
    0 to >0 pts
    No Marks
    blank_2
    This area will be used by the assessor to leave comments related to this criterion.
    pts
      / 5 pts
    --
    Additional Comments
    Total Points: 5 out of 5