refactoring
This commit is contained in:
@@ -36,19 +36,19 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def createDataFrame(dataDir, manufacturer):\n",
|
||||
" def readVaersDescr(year):\n",
|
||||
" def read_csv(file, usecols):\n",
|
||||
" return pd.read_csv(file, index_col = 'VAERS_ID', encoding = 'latin1', low_memory = False, usecols = usecols)\n",
|
||||
"\n",
|
||||
"def readVaersDescr(dataDir, year):\n",
|
||||
" folder = dataDir + \"/\" + year + \"VAERSData/\"\n",
|
||||
" return {\n",
|
||||
" 'VAERSDATA': read_csv(folder + year + \"VAERSDATA.csv\", ['VAERS_ID', 'DIED', 'L_THREAT', 'DISABLE']),\n",
|
||||
" 'VAERSVAX': read_csv(folder + year + \"VAERSVAX.csv\", ['VAERS_ID', 'VAX_TYPE', 'VAX_MANU', 'VAX_LOT'])\n",
|
||||
" }\n",
|
||||
"\n",
|
||||
"def createDataFrame(dataDir, manufacturer):\n",
|
||||
" return _createDataFrame(\n",
|
||||
" [readVaersDescr(dataDir, \"2021\"), readVaersDescr(dataDir, \"2022\")],\n",
|
||||
" [readVaersDescr(\"2021\"), readVaersDescr(\"2022\")],\n",
|
||||
" manufacturer)"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user