I have a DataFrame with four columns. I want to convert this DataFrame to a python dictionary. I want the elements of first column be keys and the elements of o
keys
If you don't mind the dictionary values being tuples, you can use itertuples:
>>> {x[0]: x[1:] for x in df.itertuples(index=False)} {'p': (1, 3, 2), 'q': (4, 3, 2), 'r': (4, 0, 9)}