【发布时间】:2018-11-19 16:49:37
【问题描述】:
我正在从flask 开发一个API,为此我不得不在函数之间使用pandas。因此,为了访问数据,我使用了 pandas iloc,但它显示错误“IndexError: single positional indexer is out-of-bounds”。
这是我的代码:
price = float(cf.loc[cf['company_name'] == 'Agricultural Development Bank Limited', 'Close'].iloc[0])
return price
如果我在 jupyter 上运行同样的东西,那么它会完美运行。
Cjeck out the screenshot of running this code in jupyter notebook
请帮忙。
【问题讨论】: