Question: Python, pandas Let say i have my dataframe df and i want to create a dictionary mydict where I set the values in column col

Python, pandas
Let say i have my dataframe df and i want to create a dictionary mydict where I set the values in column col2 as the keys for values in column col1. Im used to use the following code for it:
mydict =df.set_index('col1')['col2'].to_dict()
Now, how do i need to modify my code to make my dictionary case insensitive?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!