相关疑难解决方法(0)

FutureWarning:元素比较失败; 返回标量,但将来会执行元素比较

我0.19.1在Python 3上使用Pandas .我在这些代码行上收到警告.我试图得到一个包含所有行数,其中字符串列表Peter出现在列Unnamed: 5.

df = pd.read_excel(xls_path)
myRows = df[df['Unnamed: 5'] == 'Peter'].index.tolist()
Run Code Online (Sandbox Code Playgroud)

警告:

"\Python36\lib\site-packages\pandas\core\ops.py:792: FutureWarning: elementwise 
comparison failed; returning scalar, but in the future will perform 
elementwise comparison 
result = getattr(x, name)(y)"
Run Code Online (Sandbox Code Playgroud)

什么是FutureWarning,我应该忽略它,因为它似乎有效.

python numpy matplotlib python-3.x pandas

60
推荐指数
4
解决办法
6万
查看次数

标签 统计

matplotlib ×1

numpy ×1

pandas ×1

python ×1

python-3.x ×1