Q:

Setting csv table into a dictionary using pandas dataframe

I am new to python and trying to solve a problem below. 
I have a table in csv format that look like this:
csv table
I want to convert into a dictionary that looks this:
{'Issue ID' : '1', 'Title':'Create SAL rule for Advisors Asset Mgmt Inc', 'Status':'Pending', 'Owner':'John Smith', 'Created_Date':'1/12/2020', 'Issue ID’ : '2', 'Title':'Create MOS setup for CI Invs Inc', 'Status':'Closed', 'Owner':'Jane Down', 'Created_Date':'1/12/2020'}
I did some research and found this formula df.set_index('Issue ID').T.to_dict('list'), but it only converts 'Issue ID' as key and the rest of fields as values.

A:

The issue with your idea is the keys in the dictionary must be unique. For example, you cannot have two "Title", two "Owner" or any key that is duplicated. 
I would do something like a list and here is the code:
import pandas as pd 
from collections import defaultdict
temp = pd.read_csv("./temp.csv")
# print(temp.to_dict())
# print(temp.set_index('Issue_ID').T.to_dict('list'))
dd = defaultdict(list)

result = list(temp.to_dict('Issue_ID', into=dd).values())

And you can have something like this as result:
[{'Created_Date': ' 1/2/2020',
  'Issue_ID': 1,
  'Owner': 'John Smith',
  'Status': 'Pending',
  'Title': 'Create SAL rule for advisors'},
 {'Created_Date': ' 1/2/2020',
  'Issue_ID': 2,
  'Owner': 'Jane Down',
  'Status': 'Closed',
  'Title': 'Create MOS setup for CI Invs inc'}]

