Hey there! This is an old thread but when you read the file you get a list of strings. That is, you don't get a list of dictionaries. Therefore, Pandas will not work as you need. If you use literal_eval() from the ast module when reading your file. Here is one way you can get the results you need:
from ast import literal_eval import pandas as pd with open('test.txt') as f: data = f.readlines() data = [literal_eval(x.strip()) for x in data] data = pd.DataFrame(data) data.head() # Out[26]: # Name Age Score # 0 John 27 23 # 1 Peter 29 25Anyway, you've probably already solved this but if anyone else happens to find their way to this post when having the same problem.