Skip to content

Commit

Permalink
TDD Pandas - [GREEN] calculate this one, required column
Browse files Browse the repository at this point in the history
  • Loading branch information
diligejy committed Jan 19, 2024
1 parent 9a13925 commit 72b8c01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion PyCon_PL/Test_Driven_Pandas/tests/test_gradebook.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import pandas as pd
from typing import cast

def _create_group(raw_students_group:pd.DataFrame) -> pd.DataFrame:
result = pd.DataFrame()
return result.assign(
net_id = raw_students_group["NetID"].str.lower(),
)

def generate_gradebook(students_df:pd.DataFrame) -> dict[int, pd.DataFrame]:
return {
cast(int, group): pd.DataFrame()
cast(int, group): _create_group(raw_students_group=table)
for group, table in students_df.groupby("Group")
}

Expand Down

0 comments on commit 72b8c01

Please sign in to comment.