python-3.x - Python-遍历多个文件以读入数据框
问题描述
这是工作代码:
from urllib.request import urlretrieve
import requests
import xlrd
import pandas as pd
工作代码
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)
不工作的代码
定义将命名 ICD_9_map_ 并使用正确链接的函数
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)
解决方案
推荐阅读
- java - 不能自动配置会话存储库(会话存储类型为“redis”)
- swift - SKScene 中的对象不调用 Keydown
- python-3.x - Python 中的元类
- javascript - 从对象属性获取日期值 - javascript
- java - 强制子类将@Schedule添加到Java Spring中超抽象类中的方法
- sql - 填写数据库
- python - 我想在一系列总和上评估指数函数 e^x
- fullcalendar - 将 web2py 应用程序从 fullcalendar 3.4.0 迁移到版本 4
- java - 对特定类型的任意对象的实例方法的方法引用
- javascript - 使用 puppeteer 获取元素