1

Here is the working code:

from urllib.request import urlretrieve 
import requests
import xlrd
import pandas as pd

WORKING CODE

icd9_link = "https://www.cob.cms.hhs.gov/Section111/assets/section111/Section111ValidICD9-2017.xlsx"
icd9_map= pd.read_excel(icd9_link, sheet_name=0, header=0)

NOT WORKING CODE

Define function which will name ICD_9_map_ and use correct link

fx =  icd"{0}"_map_= pd.read_excel(icd"{1}"_link,    sheet_name=0, header=0)

#

y = [9,10]
  for x in y:
   fx.format(x, x) 
AChampion
  • 29,683
  • 4
  • 59
  • 75
Mar Marva
  • 11
  • 1
  • You can't do what you are looking to do, you are probably looking for a `dict`, see https://stackoverflow.com/questions/6181935/how-do-you-create-different-variable-names-while-in-a-loop – AChampion Aug 09 '18 at 01:47
  • Thank you AChampion! you pointed me in the right direction. – Mar Marva Aug 09 '18 at 13:24

0 Answers0