Edit: I found my answer here python pandas dataframe columns convert to dict key and value
Original post: I am attempting to write a specific dataframe column to a dictionary, yet I am also writing the index at the same time which I do not want. How do I do this the right way so I don't also include the index?
vi_dict = {}
vi_table_rvi = VI_table['RVI'].unique()
for d in vi_table_rvi:
vi_dict[f'{d}'] = VI_table['AMT'].loc[(VI_table['RVI'] == d) & (VI_table['CD'] == 102)]
My dictionary output reads something like:
key: index value
rather than
key: value
Thanks for any help.