1
我有一個樣本數據框如下:應用功能,每一行的每個字在大熊貓數據幀列
df = pd.DataFrame({
'notes': pd.Series(['speling', 'korrecter']),
'name': pd.Series(['Walter White', 'Walter White']),
})
name notes
0 Walter White This speling is incorrect
1 Walter White Corrector should correct korrecter
我想彼得·諾維格提供here相適應的拼寫檢查器。然後,我想通過遍歷行中的每個單詞來將這個函數應用於每一行。我想知道如何在Python Pandas環境中完成這項工作?
我想輸出爲:
name notes
0 Walter White This spelling is incorrect
1 Walter White Corrector should correct corrector
欣賞任何輸入。謝謝!