当前位置:网站首页>Address information parsing in one line of code
Address information parsing in one line of code
2022-07-07 00:53:00 【Zhu Weijun】
* The complete sample code and files of this article have been uploaded to my Github Warehouse https://github.com/CNFeffery/PythonPracticalSkills*
This is my article series 「「Python Practical secrets 」」 Of the 8 period , This series is based on the author's daily work Python Accumulated experience , Each issue brings you a simple skill that you can learn in a few minutes .
As the first in the series 8 period , What we are going to learn is : One line of code parses the address information .
In the process of daily data processing , Sometimes you get the complete address information , If you need to resolve the corresponding administrative unit names at all levels from the address information , There are many ways , The method to be introduced today can be implemented quickly with only one line of code .
First we need to install jionlp This very easy-to-use text preprocessing toolkit , Domestic image installation is recommended :
pip install jionlp -i https://pypi.douban.com/simple/
After installation , Just use its parse_location() The interface can resolve the address information , And has many different functions :
- Basic provincial and urban information extraction
- Street Town Township 、 Information extraction of village or neighborhood committee
By setting parameters town_village=True, You can also try to extract Street towns and townships 、 Information field of village or neighborhood committee information level :
- Automatically complete the provincial and municipal information
If the address information is missing, it doesn't matter , In the absence of ambiguity ,parse_location() It will automatically associate and complete the relevant information :
besides ,parse_location() It also has the function of revising the old place name into a new place name 、 Custom administrative division dictionary and other functions , You can find it in its official documents https://github.com/dongrixinyu/JioNLP/wiki/Gadget- documentation # Address resolution Learn more about .
The end of this sharing , I'll see you next time ~
边栏推荐
- 城联优品入股浩柏国际进军国际资本市场,已完成第一步
- dynamic programming
- Configuring OSPF basic functions for Huawei devices
- Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
- X.509 certificate based on go language
- Article management system based on SSM framework
- 做微服务研发工程师的一年来的总结
- 新手如何入门学习PostgreSQL?
- JWT signature does not match locally computed signature. JWT validity cannot be asserted and should
- 基於GO語言實現的X.509證書
猜你喜欢

How to judge whether an element in an array contains all attribute values of an object

【批處理DOS-CMD命令-匯總和小結】-字符串搜索、查找、篩選命令(find、findstr),Find和findstr的區別和辨析
![[software reverse - solve flag] memory acquisition, inverse transformation operation, linear transformation, constraint solving](/img/16/71692f4cf89b7dc0fe62946e59ecd1.png)
[software reverse - solve flag] memory acquisition, inverse transformation operation, linear transformation, constraint solving

【软件逆向-求解flag】内存获取、逆变换操作、线性变换、约束求解

【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析

Learn to use code to generate beautiful interface documents!!!

Data sharing of the 835 postgraduate entrance examination of software engineering in Hainan University in 23

Configuring the stub area of OSPF for Huawei devices

AI super clear repair resurfaces the light in Huang Jiaju's eyes, Lecun boss's "deep learning" course survival report, beautiful paintings only need one line of code, AI's latest paper | showmeai info

Configuring OSPF basic functions for Huawei devices
随机推荐
再聊聊我常用的15个数据源网站
Service asynchronous communication
深入探索编译插桩技术(四、ASM 探秘)
随时随地查看远程试验数据与记录——IPEhub2与IPEmotion APP
【YoloV5 6.0|6.1 部署 TensorRT到torchserve】环境搭建|模型转换|engine模型部署(详细的packet文件编写方法)
Zynq transplant ucosiii
The way of intelligent operation and maintenance application, bid farewell to the crisis of enterprise digital transformation
STM32开发资料链接分享
Mujoco Jacobi - inverse motion - sensor
Attention slam: a visual monocular slam that learns from human attention
Meet the level 3 requirements of ISO 2.0 with the level B construction standard of computer room | hybrid cloud infrastructure
[force buckle]41 Missing first positive number
深度学习简史(二)
@TableId can‘t more than one in Class: “com.example.CloseContactSearcher.entity.Activity“.
Advanced learning of MySQL -- basics -- transactions
做微服务研发工程师的一年来的总结
Alexnet experiment encounters: loss Nan, train ACC 0.100, test ACC 0.100
【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
Mujoco finite state machine and trajectory tracking
How engineers treat open source -- the heartfelt words of an old engineer