【问题标题】:How to clean data having spelling mistakes如何清理有拼写错误的数据
【发布时间】:2020-07-01 10:26:30
【问题描述】:

我的数据如下:

Carepnter
Carpentor
Labourer
Labor
Labour
Housewife
House Wife
housewife.

我想清理数据并纠正拼写错误,但不是手动,因为它是一个庞大的数据。由于拼写错误,这些 50/60 的职业已经变成了 2000 年左右。

【问题讨论】:

    标签: data-munging


    【解决方案1】:

    您必须找到接近实际职业的字符串,例如木匠。 然后你可以尝试找到最接近它的 n-matches。

    此处的另一个问题也涉及查找相似字符串 (Python: find closest string (from a list) to another string),您的答案中的解决方案可能是:

    1. difflib.get_close_matches

    2. Spelling corrector

    【讨论】:

      猜你喜欢
      • 2021-06-06
      • 2022-12-07
      • 2013-09-20
      • 1970-01-01
      • 2018-08-19
      • 2021-11-21
      • 2021-03-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多