当前位置:网站首页>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 ~
边栏推荐
- 新手如何入门学习PostgreSQL?
- Link sharing of STM32 development materials
- 代码克隆的优缺点
- Stm32f407 ------- DAC digital to analog conversion
- Hero League | King | cross the line of fire BGM AI score competition sharing
- 【软件逆向-自动化】逆向工具大全
- 通过串口实现printf函数,中断实现串口数据接收
- New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
- Uniapp uploads and displays avatars locally, and converts avatars into Base64 format and stores them in MySQL database
- 在jupyter中实现实时协同是一种什么体验
猜你喜欢

Part IV: STM32 interrupt control programming

pyflink的安装和测试

Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing

【vulnhub】presidential1

第四篇,STM32中断控制编程

英雄联盟|王者|穿越火线 bgm AI配乐大赛分享

alexnet实验偶遇:loss nan, train acc 0.100, test acc 0.100情况

Stm32f407 ------- DAC digital to analog conversion

Five different code similarity detection and the development trend of code similarity detection
![[software reverse automation] complete collection of reverse tools](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[software reverse automation] complete collection of reverse tools
随机推荐
集合(泛型 & List & Set & 自定义排序)
Alexnet experiment encounters: loss Nan, train ACC 0.100, test ACC 0.100
How to set encoding in idea
Advanced learning of MySQL -- basics -- multi table query -- inner join
build. How to configure the dependent version number in the gradle file
VTK volume rendering program design of 3D scanned volume data
@TableId can‘t more than one in Class: “com.example.CloseContactSearcher.entity.Activity“.
Markov decision process
【软件逆向-自动化】逆向工具大全
The difference between redirectto and navigateto in uniapp
Learn to use code to generate beautiful interface documents!!!
Interface (interface related meaning, different abstract classes, interface callback)
Part 7: STM32 serial communication programming
深度学习之数据处理
深度学习之线性代数
How to judge whether an element in an array contains all attribute values of an object
批量获取中国所有行政区域经边界纬度坐标(到县区级别)
Learning notes 5: ram and ROM
View remote test data and records anytime, anywhere -- ipehub2 and ipemotion app
Stm32f407 ------- SPI communication