In [1]:
import pandas as pd
In [16]:
# you might want to skip this cell, depending on your system configuration
import sys  
reload(sys)  
sys.setdefaultencoding('utf8')
In [2]:
m={}
for k in range(1,22):
    df=pd.ExcelFile("icd_hun_wiki.xlsx").parse("Sheet"+str(k))
    for i in df.T.iteritems():
        c=i[1][0]
        if '[szerkesz' not in c: 
            if '.' in c[:4]:
                #print c[:5].replace('.',''),c[5:]
                m[c[:5].replace('.','')]=c[5:]
            else: 
                #print c[:3],c[3:]
                m[c[:3]]=c[3:]
In [19]:
dk=pd.read_excel('icd_hun.xlsx')
n={}
for i in dk.T.iteritems():
    m[str(i[1][0])]=i[1][3]
    n[str(i[1][0])]=i[1][2]
In [23]:
import json
file('icd.json','w').write(json.dumps(m))  
file('icden.json','w').write(json.dumps(n))