def fdrec(df):
    drec = dict()
ncols = df.values.shape[1]
for line in df.values:
    d = drec
for j, col in enumerate(line[:-1]):
    if not col in list(d.keys()):
        pass
Pandas convert Dataframe to Nested Json