当前位置:网站首页>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 ~
边栏推荐
- 再聊聊我常用的15个数据源网站
- 【YoloV5 6.0|6.1 部署 TensorRT到torchserve】环境搭建|模型转换|engine模型部署(详细的packet文件编写方法)
- Are you ready to automate continuous deployment in ci/cd?
- Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
- Three methods to realize JS asynchronous loading
- How to set encoding in idea
- How to get started and improve test development?
- 什么是时间
- Advanced learning of MySQL -- basics -- multi table query -- subquery
- Five different code similarity detection and the development trend of code similarity detection
猜你喜欢
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
[yolov5 6.0 | 6.1 deploy tensorrt to torch serve] environment construction | model transformation | engine model deployment (detailed packet file writing method)
Learn to use code to generate beautiful interface documents!!!
[user defined type] structure, union, enumeration
[Niuke classic question 01] bit operation
【软件逆向-自动化】逆向工具大全
【vulnhub】presidential1
Article management system based on SSM framework
Mujoco finite state machine and trajectory tracking
随机推荐
Zabbix 5.0:通过LLD方式自动化监控阿里云RDS
What is time
【软件逆向-求解flag】内存获取、逆变换操作、线性变换、约束求解
Js+svg love diffusion animation JS special effects
在jupyter中实现实时协同是一种什么体验
Advanced learning of MySQL -- basics -- multi table query -- inner join
stm32F407-------SPI通信
Are you ready to automate continuous deployment in ci/cd?
Stm32f407 ------- SPI communication
OSPF configuration command of Huawei equipment
Understand the misunderstanding of programmers: Chinese programmers in the eyes of Western programmers
三维扫描体数据的VTK体绘制程序设计
Mujoco finite state machine and trajectory tracking
Leetcode (547) - number of provinces
做微服务研发工程师的一年来的总结
Link sharing of STM32 development materials
QT tutorial: creating the first QT program
深度学习简史(二)
509 certificat basé sur Go
用tkinter做一个简单图形界面