将中文转换为拼音首字母,效果:
需要用到计算字段(GP或python都可以)
计算字段GP:
1 # 转换汉字的代码块 2 def transChinese(inputfield): 3 from pypinyin import lazy_pinyin 4 for i in inputfield: 5 namea = inputfield 6 cn_namelist = lazy_pinyin(namea) 7 firstLetterCo = [] 8 for char in cn_namelist: 9 firstLetter = char[0] 10 firstLetterCo.append(firstLetter) 11 firstLetterCo1 = ''.join(firstLetterCo).upper() 12 break 13 return firstLetterCo1
标签:firstLetterCo,inputfield,转换,拼音,ArcGIS,Pro,首字母,字段 From: https://www.cnblogs.com/jiangyuanjia/p/17602132.html