jrg94 / personal-data

A collection of real-world CSV files for data analysis
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

Education Data Functions Like a Database #5

Closed jrg94 closed 6 months ago

jrg94 commented 7 months ago

This is less of an issue and more of a note to self, but I was able to achieve the following with the new data setup:

>>> grading_history.merge(assignment_lookup, on="Assignment ID").merge(assignment_group_lookup, on="Assignment Group ID").merge(teaching_history, on="Section ID")
       Section ID  Student ID  Assignment ID Grade  Total  Assignment Group ID Assignment Name Assignment Group Name  Assignment Group Weight  Course ID  Year  Season Course Type  Days Start Time End Time Building Room Number                    Job Title                  Role
0           26319           1              1  2.00    2.0                    1      Homework 1             Homeworks                        4          1  2018  Autumn     Lecture  MoWe      13:50    14:45       UH         082  Graduate Teaching Associate  Instructor of Record
1           26319           2              1  1.00    2.0                    1      Homework 1             Homeworks                        4          1  2018  Autumn     Lecture  MoWe      13:50    14:45       UH         082  Graduate Teaching Associate  Instructor of Record
2           26319           3              1  2.00    2.0                    1      Homework 1             Homeworks                        4          1  2018  Autumn     Lecture  MoWe      13:50    14:45       UH         082  Graduate Teaching Associate  Instructor of Record
3           26319           4              1  2.00    2.0                    1      Homework 1             Homeworks                        4          1  2018  Autumn     Lecture  MoWe      13:50    14:45       UH         082  Graduate Teaching Associate  Instructor of Record
4           26319           5              1  2.00    2.0                    1      Homework 1             Homeworks                        4          1  2018  Autumn     Lecture  MoWe      13:50    14:45       UH         082  Graduate Teaching Associate  Instructor of Record
...           ...         ...            ...   ...    ...                  ...             ...                   ...                      ...        ...   ...     ...         ...   ...        ...      ...      ...         ...                          ...                   ...
25140       12411          36            161  4.00    4.0                   22   Participation         Participation                        4          3  2023  Autumn     Lecture  WeFr      10:20    11:15       CH         232                     Lecturer  Instructor of Record
25141       12411          37            161  4.00    4.0                   22   Participation         Participation                        4          3  2023  Autumn     Lecture  WeFr      10:20    11:15       CH         232                     Lecturer  Instructor of Record
25142       12411          38            161  4.00    4.0                   22   Participation         Participation                        4          3  2023  Autumn     Lecture  WeFr      10:20    11:15       CH         232                     Lecturer  Instructor of Record
25143       12411          39            161  3.00    4.0                   22   Participation         Participation                        4          3  2023  Autumn     Lecture  WeFr      10:20    11:15       CH         232                     Lecturer  Instructor of Record
25144       12411          40            161  4.00    4.0                   22   Participation         Participation                        4          3  2023  Autumn     Lecture  WeFr      10:20    11:15       CH         232                     Lecturer  Instructor of Record

[25145 rows x 20 columns]
jrg94 commented 7 months ago

Just one more merge gives us a rich 23-column table:

>>> grading_history.merge(assignment_lookup, on="Assignment ID").merge(assignment_group_lookup, on="Assignment Group ID").merge(teaching_history, on="Section ID").merge(course_lookup, on="Course ID")
       Section ID  Student ID  Assignment ID Grade  Total  Assignment Group ID Assignment Name Assignment Group Name  Assignment Group Weight  ...  Start Time  End Time Building Room Number                    Job Title                  Role Department Course Number                                   Course Name
0           26319           1              1  2.00    2.0                    1      Homework 1             Homeworks                        4  ...       13:50     14:45       UH         082  Graduate Teaching Associate  Instructor of Record        CSE          1223  Introduction to Computer Programming in Java
1           26319           2              1  1.00    2.0                    1      Homework 1             Homeworks                        4  ...       13:50     14:45       UH         082  Graduate Teaching Associate  Instructor of Record        CSE          1223  Introduction to Computer Programming in Java
2           26319           3              1  2.00    2.0                    1      Homework 1             Homeworks                        4  ...       13:50     14:45       UH         082  Graduate Teaching Associate  Instructor of Record        CSE          1223  Introduction to Computer Programming in Java
3           26319           4              1  2.00    2.0                    1      Homework 1             Homeworks                        4  ...       13:50     14:45       UH         082  Graduate Teaching Associate  Instructor of Record        CSE          1223  Introduction to Computer Programming in Java
4           26319           5              1  2.00    2.0                    1      Homework 1             Homeworks                        4  ...       13:50     14:45       UH         082  Graduate Teaching Associate  Instructor of Record        CSE          1223  Introduction to Computer Programming in Java
...           ...         ...            ...   ...    ...                  ...             ...                   ...                      ...  ...         ...       ...      ...         ...                          ...                   ...        ...           ...                                           ...
25140       12411          36            161  4.00    4.0                   22   Participation         Participation                        4  ...       10:20     11:15       CH         232                     Lecturer  Instructor of Record        CSE          2231   Software 2: Software Development and Design
25141       12411          37            161  4.00    4.0                   22   Participation         Participation                        4  ...       10:20     11:15       CH         232                     Lecturer  Instructor of Record        CSE          2231   Software 2: Software Development and Design
25142       12411          38            161  4.00    4.0                   22   Participation         Participation                        4  ...       10:20     11:15       CH         232                     Lecturer  Instructor of Record        CSE          2231   Software 2: Software Development and Design
25143       12411          39            161  3.00    4.0                   22   Participation         Participation                        4  ...       10:20     11:15       CH         232                     Lecturer  Instructor of Record        CSE          2231   Software 2: Software Development and Design
25144       12411          40            161  4.00    4.0                   22   Participation         Participation                        4  ...       10:20     11:15       CH         232                     Lecturer  Instructor of Record        CSE          2231   Software 2: Software Development and Design

[25145 rows x 23 columns]