2
我檢查是否有任何滿足條件的df4中的任何行。 但它會引發錯誤「索引超出範圍」。任何幫助,將不勝感激。如果條件熊貓數據框
if (df4[df4['Occurences']] >= 5).any():
df7 = df4[df4['Occurences'] >= 5].reset_index()
df8 = df7[['MachineName','DateTime','Occurences']]
rpt = dataframeToHtmlTable(df8)
sendNotificationAlive(rpt, ['[email protected]'])
這看起來錯了:'如果(DF4 [DF4 [ '出現次數' ]]> = 5).any():'不是它應該是'if(df4 [df4 ['Occurences']> = 5])。any():'? – EdChum