我有一個有兩列的數據幀。一列包含句子列表,另一列包含單詞。例如:根據兩列之間的匹配值(精確)過濾數據幀
words sentences
loose Loose connection several times a day on my tablet.
loud People don't speak loud or clear enough to hear voicemails
vice I strongly advice you to fix this issue
advice I strongly advice you to fix this issue
現在我要過濾這些數據幀,這樣我只得到具有恰好匹配句子中的單詞的那些行:
words sentences
loose Loose connection several times a day on my tablet.
loud People don't speak loud or clear enough to hear voicemails
advice I strongly advice you to fix this issue
這個詞「副」並不完全匹配,因此必須將其刪除。我在數據框中有近20k行。有人可以建議我使用哪種方法來完成這項任務,這樣我就不會失去太多的表現。
這種方法比使用str_detect更快,因此接受這個答案。 – Venu