import json import pandas as pd import numpy as np import matplotlib.pyplot as plt if __name__=="__main__": path="usagov_bitly_data2012-03-16-1331923249.txt" fp=open(path) records=[json.loads(line) for line in fp.readlines()] print(len(records)) frame=pd.DataFrame(records) print(frame['tz']) clean_tz=frame['tz'].fillna('Missing') clean_tz[clean_tz=='']='Unknown' tz_counts=clean_tz.value_counts() print(tz_counts[:20]) tz_counts[:10].plot(kind='barh',rot=0) plt.show()