我正在使用熊猫从Excel文件中读取数据。我只想在访问过的某个地区查看数据。Python熊猫参考“/”的列
我得到被标记在电子表格中的列访问以下错误“就诊(Y/N)”:
AttributeError: 'DataFrame' object has no attribute 'VISIT'
这是我使用的代码。如何让python将“访问(是/否)”解释为一列?
import pandas as pd
df=pd.read_excel("myFile.xlsx")
data = df[(df.REGION == "AMER") & df.VISIT(Y/N) == "Y")]
print(list(df))
print(data)
谢谢那完美的工作! – Ariel