I have a data frame as follows
0 1 2 3 4 5 6 7 8 9
window
1000 210 227 224 223 215 239 224 217 228 218
1500 306 304 262 267 304 294 291 283 272 267
2000 294 252 362 315 286 302 358 284 318 291
2500 322 326 332 262 367 251 272 354 360 373
3000 400 253 388 400 345 400 400 359 264 310
3500 260 400 400 321 365 285 374 335 308 342
4000 400 400 400 386 304 400 332 305 350 386
I want to convert it into dictionary like
{'1000 :[210 227 224 223 215 239 224 217 228 218]
'1500' :[306 304 262 267 304 294 291 283 272 267]
'2000' :[294 252 362 315 286 302 358 284 318 291]
'2500' :[322 326 332 262 367 251 272 354 360 373]
'3000' :[400 253 388 400 345 400 400 359 264 310]
'3500' :[260 400 400 321 365 285 374 335 308 342]
'4000' :[400 400 400 386 304 400 332 305 350 386]}
I have tried mentioned solution by following this link
dictionary= df.set_index('window').T.to_dict('list')
print dictionary
But I am getting following error