Skip to content

Commit

Permalink
Test Driven Pandas - [GREEN] Create real groups of results
Browse files Browse the repository at this point in the history
  • Loading branch information
diligejy committed Jan 19, 2024
1 parent 214f70a commit a7506e4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions PyCon_PL/Test_Driven_Pandas/tests/test_gradebook.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import pandas as pd
from typing import cast

def generate_gradebook(students_df:pd.DataFrame) -> dict[int, pd.DataFrame]:
return {1: pd.DataFrame()}

return {
cast(int, group): pd.DataFrame()
for group, table in students_df.groupby("Group")
}

def test_results_are_grouped_by_student_group():
students = [{
"ID" : 1,
Expand All @@ -25,7 +29,7 @@ def test_results_are_grouped_by_student_group_for_students_in_multiple_group():
"Group" : 1,
},{
"ID" : 2,
"Name" : "Alec, Curry ",
"Name" : "Alec, Curry",
"NetID" : "AMC53511",
"Email Address" : "ALEC.CURRY@EXAMPLE.EDU",
"Group" : 2,
Expand Down

0 comments on commit a7506e4

Please sign in to comment.