当前位置:网站首页>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 ~
边栏推荐
- Set (generic & list & Set & custom sort)
- 【JokerのZYNQ7020】AXI_ EMC。
- 通过串口实现printf函数,中断实现串口数据接收
- 代码克隆的优缺点
- Model-Free Control
- Learning notes 5: ram and ROM
- 用tkinter做一个简单图形界面
- Web project com mysql. cj. jdbc. Driver and com mysql. jdbc. Driver differences
- Attention SLAM:一种从人类注意中学习的视觉单目SLAM
- Advanced learning of MySQL -- basics -- transactions
猜你喜欢
@TableId can‘t more than one in Class: “com.example.CloseContactSearcher.entity.Activity“.
【vulnhub】presidential1
Configuring OSPF basic functions for Huawei devices
The way of intelligent operation and maintenance application, bid farewell to the crisis of enterprise digital transformation
深度学习之环境配置 jupyter notebook
深度学习之线性代数
用tkinter做一个简单图形界面
Attention SLAM:一种从人类注意中学习的视觉单目SLAM
Service asynchronous communication
Win10 startup error, press F9 to enter how to repair?
随机推荐
Article management system based on SSM framework
Configuring OSPF basic functions for Huawei devices
Mujoco second order simple pendulum modeling and control
Advanced learning of MySQL -- basics -- transactions
509 certificat basé sur Go
【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
dynamic programming
[yolov5 6.0 | 6.1 deploy tensorrt to torch serve] environment construction | model transformation | engine model deployment (detailed packet file writing method)
Five different code similarity detection and the development trend of code similarity detection
[software reverse - solve flag] memory acquisition, inverse transformation operation, linear transformation, constraint solving
腾讯云 WebShell 体验
Win10 startup error, press F9 to enter how to repair?
Data sharing of the 835 postgraduate entrance examination of software engineering in Hainan University in 23
基於GO語言實現的X.509證書
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
Advanced learning of MySQL -- Fundamentals -- four characteristics of transactions
【YoloV5 6.0|6.1 部署 TensorRT到torchserve】环境搭建|模型转换|engine模型部署(详细的packet文件编写方法)
建立自己的网站(17)
Attention SLAM:一種從人類注意中學習的視覺單目SLAM