当前位置:网站首页>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 ~
边栏推荐
- Advanced learning of MySQL -- Fundamentals -- four characteristics of transactions
- Distributed cache
- 【批处理DOS-CMD命令-汇总和小结】-跳转、循环、条件命令(goto、errorlevel、if、for[读取、切分、提取字符串]、)cmd命令错误汇总,cmd错误
- 学习光线跟踪一样的自3D表征Ego3RT
- QT tutorial: creating the first QT program
- Service asynchronous communication
- Mujoco finite state machine and trajectory tracking
- 深度学习简史(二)
- 【软件逆向-自动化】逆向工具大全
- Basic information of mujoco
猜你喜欢
Part 7: STM32 serial communication programming
详解OpenCV的矩阵规范化函数normalize()【范围化矩阵的范数或值范围(归一化处理)】,并附NORM_MINMAX情况下的示例代码
If the college entrance examination goes well, I'm already graying out at the construction site at the moment
equals()与hashCode()
Learn to use code to generate beautiful interface documents!!!
5种不同的代码相似性检测,以及代码相似性检测的发展趋势
Deep learning environment configuration jupyter notebook
基于SSM框架的文章管理系统
New feature of Oracle 19C: automatic DML redirection of ADG, enhanced read-write separation -- ADG_ REDIRECT_ DML
[software reverse automation] complete collection of reverse tools
随机推荐
@TableId can‘t more than one in Class: “com.example.CloseContactSearcher.entity.Activity“.
Slow database query optimization
Advanced learning of MySQL -- basics -- multi table query -- subquery
If the college entrance examination goes well, I'm already graying out at the construction site at the moment
【批处理DOS-CMD命令-汇总和小结】-字符串搜索、查找、筛选命令(find、findstr),Find和findstr的区别和辨析
Part IV: STM32 interrupt control programming
Win10 startup error, press F9 to enter how to repair?
ZYNQ移植uCOSIII
Data analysis course notes (III) array shape and calculation, numpy storage / reading data, indexing, slicing and splicing
Advanced learning of MySQL -- Fundamentals -- four characteristics of transactions
【批處理DOS-CMD命令-匯總和小結】-字符串搜索、查找、篩選命令(find、findstr),Find和findstr的區別和辨析
Advanced learning of MySQL -- basics -- basic operation of transactions
做微服务研发工程师的一年来的总结
Attention SLAM:一種從人類注意中學習的視覺單目SLAM
Quaternion attitude calculation of madgwick
Data analysis course notes (V) common statistical methods, data and spelling, index and composite index
通过串口实现printf函数,中断实现串口数据接收
第七篇,STM32串口通信编程
Mujoco second order simple pendulum modeling and control
Learning notes 5: ram and ROM