import pandas as pd
a=int(input())
c=str(input())
d=int(input())
max=0
path1='counties.csv'
path2='case(1).csv'
path3='death.csv'
df=pd.read_csv(path1)
df.loc[:,'date']=df['date'].str.replace('/','').astype('int32')
df.set_index('sj',inplace=True)
#print(df.loc[(df['county']==c)&(df['date']==d),'cases':'deaths'])
dp=pd.read_csv(path2)
dp.loc[:,'date']=dp['date'].str.replace('/','').astype('int32')
dp.set_index('date',inplace=True)
#print(dp.loc[df['date']==d,'Utah'])
dg=pd.read_csv(path3)
dg.loc[:,'date']=dg['date'].str.replace('/','').astype('int32')
dg.set_index('date',inplace=True)
if a==1:
print(df.loc[(df['date']==d)&(df['county']==c),'cases':'deaths'])#这儿应该如何改变
elif a==2:
print('案例:',dp.loc[d,c],end=' ')
print('死亡人数:',dg.loc[d,c])
输入
1
Cook
2020124
得到的结果
cases deaths
sj
2020/1/24 1 0
我想要得到其中具体的值,而不是得到一个列表,因应该怎么改变