I have some confusion with the output of the way I use dict comprehension~
birthday_dict = {data.name: (data.month, data.day) for (index, data) in df_birthday.iterrows()}
gives me
{0: (3, 24), 1: (6, 20), 2: (1, 20)}
birthday_dict = {data["name"]: (data.month, data.day) for (index, data) in df_birthday.iterrows()}
gives me
{'John': (3, 24), 'Alex': (6, 20), 'Dave': (1, 20)}
I thought that data.name is the same as data["name"] however they give different results when inserted as key index. I definitely prefer the latter one which makes the dictionary clearer on who's birthday the key value is giving but just wanted know the reasoning behind the different output in key index.
Thanks for your time!