Pandy do słownika
df.to_dict('records')
Poor Porcupine
df.to_dict('records')
#Use the Dataframe index as the key of the dictionary
df.to_dict('index')
{'Name': ['John', 'Sara', 'John', 'Sara'],
'Sem': ['Sem1', 'Sem1', 'Sem2', 'Sem2'],
'Subject': ['Mathematics', 'Biology', 'Biology', 'Mathematics'],
'Grade': ['A', 'B', 'A+', 'B++']}