當前位置:成語大全網 - 書法字典 - 熊貓。DataFrame.loc這麽慢,怎麽遍歷和訪問DataFrame比較快?

熊貓。DataFrame.loc這麽慢,怎麽遍歷和訪問DataFrame比較快?

如果for用於遍歷,pandas比普通python程序要慢。

嘗試Series.apply函數調用do _ something _ with _ time,您自然會得到壹個新的已處理時間列。

df . time 2 = df . time . apply(do _ some _ things _ with _ time)

或者直接將其分配給df.time