我不明白,爲什麼下面的代碼工作:蟒蛇:收到縮進錯誤原因不明
if trend == 1:
maeName = tempMae.dif.idxmax()
else:
maeName = tempMae.dif.abs().idxmin()
雖然下面的代碼:
if trend == 1:
maeValue = tempMae.dif.max()
maeName = tempMae.dif.idxmax()
else:
maeValue = tempMae.dif.min()
maeName = tempMae.dif.abs().idxmin()
返回錯誤:IndentationError: unindent does not match any outer indentation level
請使用代碼示例工具。 – Tim
要麼混合標籤與空格(這很可能是您的編輯器的設置),或整個代碼縮進是錯誤的(即沒有父塊或左右) – tobspr
這是一些錯誤消息,當某些指令不是與同一塊的其他指令正確對齊。檢查是否沒有空間或缺少空間。您發佈的代碼是正確的。 – Tim