我想在pandas数据表中搜索终端输入给定的特定列并打印其值。 这是我试过的代码
maps= pnd.read_excel('Maps.xlsx', index_col=0, index_row=0, header=1)
M = input ('which maps are you playing?')
if M in maps.columns:
print ('ok')
w = maps.M.values
问题是python没有将M作为变量来读取,而是将M作为“M”来读取。我已经尝试过类似的w=maps.str(M).values
或类似的东西,但什么都没有。
有什么建议吗?谢谢
你呢:
相关问题 更多 >
编程相关推荐