Question: I am trying to convert a dictionary with a tuple keys and a list value to dataframe, like key1, key2, value. Here is the dictionary:

```
dict_f = {'(4312,5135)':[0,0.11,0.22],'(1515,32)':[0.92,0.11,0.65],'(42,56)':[0.2,0.5,0.23]}

```

I tried like this:

```
pd.DataFrame({'Keys': dict_f.keys(), 'Values': dict_f.values()})

```

But i couldn't seperate the keys from the dictionary keys().

I want the result come out to be

```
    key1  key2  value
0 4312  5135 [0,0.11,0.22]
1 1515  32   [0.92,0.11,0.65]
2 42    56   [0.2,0.5,0.23]

```

Answer: 
It seems you need `MultiIndex` from `keys` of `dict`:

```
df = pd.DataFrame(dict_f)
df.columns = df.columns.str.strip('()').str.split(',', expand=True)
print (df)
   1515    42  4312
     32    56  5135
0  0.92  0.20  0.00
1  0.11  0.50  0.11
2  0.65  0.23  0.22

print (df.columns)
MultiIndex(levels=[['1515', '42', '4312'], ['32', '5135', '56']],
           labels=[[0, 1, 2], [0, 2, 1]])

```

If need another format:

```
s = pd.Series(dict_f)
#if keys are strings, convert to tuples
s.index = s.index.str.strip('()').str.split(',', expand=True)
print (s)
1515  32      [0.92, 0.11, 0.65]
42    56        [0.2, 0.5, 0.23]
4312  5135       [0, 0.11, 0.22]
dtype: object

df1 = s.reset_index()
df1.columns = ['key1','key2','features']
print (df1)
   key1  key2            features
0  1515    32  [0.92, 0.11, 0.65]
1    42    56    [0.2, 0.5, 0.23]
2  4312  5135     [0, 0.11, 0.22]

```
```
def pkl_dict_to_df(df):
        data_df = pd.DataFrame({'keys': df.keys(), 'features': df.values()})
        data_df['key1'] = data_df['keys'].apply(lambda x: x[0])
        data_df['key2'] = data_df['keys'].apply(lambda x: x[1])
        return data_df[['key1','key2','features']]

```

I solve it by the code above , but I think there must be a simple way