DataFrame to Dict tanpa indeks
df.to_dict('index')
Cute Cheetah
df.to_dict('index')
df.to_dict(orient='records')
df.to_dict('list')
#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++']}