【发布时间】:2021-01-09 11:18:31
【问题描述】:
当我在下面的地理区域输入法国时,它给了我错误,有人可以帮忙吗?
geo = input("Select the country you´d like to analyze (France / Germany / Spain): ")
churn_ds = pd.read_csv('../input/predicting-churn-for-bank-customers/Churn_Modelling.csv', sep=",",).query('Geography' == geo)
#ValueError: expr must be a string to be evaluated, <class 'bool'> given
【问题讨论】:
-
不要使用
query,而是使用churn_ds = pd.read_csv('...')['Geography'==geo] -
您好,您现在已经有了答案,您可以考虑accepting an answer 来奖励给您最有帮助的评论。
标签: python pandas string input