我還是一個新的Python,使用熊貓,我有一些問題調試我的Python腳本。如何找出哪裏的Python警告是從
我有以下警告消息:
[...]\pandas\core\index.py:756: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
return self._engine.get_loc(key)
,並不能找到它來自的。
經過一番研究,我試圖做的是,在熊貓庫文件(index.py):
try:
return self._engine.get_loc(key)
except UnicodeWarning:
warnings.warn('Oh Non', stacklevel=2)
但是,這並沒有改變有關的警告信息任何東西。
我認爲最簡單的方法是強制它提高,然後你可以正常調試。 –