for x in range(len(ptest)):
    currentid = ptest.iloc[x, 0]
currentvalue = ptest.iloc[x, 1]
mydict.setdefault(currentid, [])
mydict[currentid].append(currentvalue)
mydict
python pandas dataframe to dictionary