Python中实现拼音排序
如题,使用场景如论文文献拼音排序等。具体需要根据自己的数据情况修改一下代码。import pandas as pd
import numpy as np
from pypinyin import lazy_pinyin
data = pd.read_table(r"C:\...\input.txt", sep = '\t')
data["B"] = data["A"].apply(lambda x : x)
data["C"] = [''.join(lazy_pinyin(_)) for _ in data["B"]]
data = data.sort_values(by = "C")
data
页:
[1]