{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# you might want to skip this cell, depending on your system configuration\n", "import sys \n", "reload(sys) \n", "sys.setdefaultencoding('utf8')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "m={}\n", "for k in range(1,22):\n", " df=pd.ExcelFile(\"icd_hun_wiki.xlsx\").parse(\"Sheet\"+str(k))\n", " for i in df.T.iteritems():\n", " c=i[1][0]\n", " if '[szerkesz' not in c: \n", " if '.' in c[:4]:\n", " #print c[:5].replace('.',''),c[5:]\n", " m[c[:5].replace('.','')]=c[5:]\n", " else: \n", " #print c[:3],c[3:]\n", " m[c[:3]]=c[3:]" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [], "source": [ "dk=pd.read_excel('icd_hun.xlsx')\n", "n={}\n", "for i in dk.T.iteritems():\n", " m[str(i[1][0])]=i[1][3]\n", " n[str(i[1][0])]=i[1][2]" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import json\n", "file('icd.json','w').write(json.dumps(m)) \n", "file('icden.json','w').write(json.dumps(n)) " ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }