Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is the data:
- QuestionID QuestionStem QuestionOrder AnswerId AnswerText AnswerOrder isCorrect Class Date
- 100 What color is the sky? 0 11 Red 0 0 Astro 101 2023-08-23
- 100 What color is the sky? 0 11 Green 1 0 Astro 101 2023-08-23
- 100 What color is the sky? 0 11 Gold 2 0 Astro 101 2023-08-23
- 100 What color is the sky? 0 11 Blue 3 1 Astro 101 2023-08-23
- And the only code change I made to your answer is this:
- # Get data from SQL Server and put into a pandas dataframe
- df = pd.read_sql_query(qry, engine)
- # Iterate over the dataframe rows
- for exam in Exam.from_data(df.values.tolist()):
- print(exam)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement