Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/DQinYuan/chinese_province_city_area_mapper
/ functions
Functions
68 in github.com/DQinYuan/chinese_province_city_area_mapper
⨍
Functions
68
◇
Types & classes
12
↓ 21 callers
Function
_assert_line
(addr_df, pos_sensitive, linenum, province, city, area, addr, adcode, province_pos=-1, city_p
tests/test_cpca.py:100
↓ 9 callers
Method
add_addr_info
(self, addr_info)
cpca/matcher.py:58
↓ 7 callers
Function
ad2addr
(part_adcode)
cpca/drawer.py:9
↓ 7 callers
Method
iter
(self, sentence)
cpca/matcher.py:70
↓ 6 callers
Function
adcode_name
(part_adcode: str)
cpca/__init__.py:233
↓ 4 callers
Function
empty_record
(pos_sensitive: bool)
cpca/__init__.py:152
↓ 3 callers
Method
_assert
(self, p_name, assert_name)
tests/test_structures.py:54
↓ 3 callers
Method
append_relational_addr
(self, key, pca_tuple, full_name_pos)
cpca/structures.py:33
↓ 3 callers
Method
get_relational_addrs
(self, key)
cpca/structures.py:26
↓ 3 callers
Method
is_unique_value
key所映射到的地址列表中的地址是否唯一
cpca/structures.py:19
↓ 3 callers
Function
update_res_by_adcode
(res: dict, adcode: str)
cpca/__init__.py:238
↓ 2 callers
Function
_extract_addrs
提取出 sentence 中的所有地址
cpca/__init__.py:173
↓ 2 callers
Function
_fill_adcode
(adcode)
cpca/__init__.py:229
↓ 2 callers
Method
_get
(self, key)
cpca/matcher.py:67
↓ 2 callers
Function
assert_addr
(addr_df: pd.DataFrame, pos_sensitive=False)
tests/test_cpca.py:15
↓ 2 callers
Method
complete_add
(self)
cpca/matcher.py:64
↓ 2 callers
Function
get_body
(url)
sync.py:15
↓ 2 callers
Method
get_match_addr
(self, parent_addr, first_adcode=None)
cpca/matcher.py:13
↓ 2 callers
Method
get_one_addr
(self)
cpca/matcher.py:25
↓ 2 callers
Method
get_rank
(self)
cpca/matcher.py:22
↓ 2 callers
Method
propertys_dict
(self, pos_sensitive)
cpca/structures.py:49
↓ 2 callers
Function
set_pos
(res, rank, pos)
cpca/__init__.py:162
↓ 2 callers
Function
tidy_order
整理顺序,唯一作用是让列的顺序好看一些
cpca/__init__.py:135
↓ 1 callers
Method
__init__
(self, province = '', city = '', area = '', province_pos = -1, city_pos = -1, area_pos = -1)
cpca/structures.py:41
↓ 1 callers
Method
_abbr_name
(self, origin_name)
cpca/matcher.py:47
↓ 1 callers
Method
_first_add_addr
(self, addr_info)
cpca/matcher.py:50
↓ 1 callers
Function
_get_one_addr
(sentence, pos_sensitive, umap)
cpca/__init__.py:169
↓ 1 callers
Function
_init_data
(stop_key="([省市]|特别行政区|自治区)$")
cpca/__init__.py:65
↓ 1 callers
Method
belong_to
通过 adcode 判断当前 addr 是否属于 other
cpca/__init__.py:58
↓ 1 callers
Method
get_full_name
(self, key)
cpca/structures.py:16
↓ 1 callers
Method
get_value
获得映射的第一个地址, 必须保证该key存在, 不然会出错
cpca/structures.py:29
↓ 1 callers
Function
pos_setter
(pos_sensitive)
cpca/__init__.py:161
Method
__init__
(self, name, adcode, longitude, latitude)
cpca/__init__.py:43
Method
__init__
(self, attr_infos, start_index, end_index)
cpca/__init__.py:146
Method
__init__
(self, attr_infos, start_index, end_index, origin_value)
cpca/matcher.py:7
Method
__init__
(self, stop_re)
cpca/matcher.py:43
Method
__init__
(self)
cpca/structures.py:13
Method
__repr__
(self)
cpca/matcher.py:28
Function
_base_input_check
(locations)
cpca/drawer.py:13
Function
_dict2addr_map
(mydict, valuedict = {}, is_unique_value = True)
tests/test_cpca.py:89
Function
_geo_update
(geo, adcodes)
cpca/drawer.py:23
Function
draw_locations
基于folium生成地域分布的热力图的html文件. :param adcodes: 地址集 :param file_path: 生成的html文件的路径.
cpca/drawer.py:35
Function
echarts_cate_draw
依据分类生成地域分布的echarts散点图的html文件. :param adcodes: 地址集 :param labels: 长度必须和locations相等, 代表每个样本所属的分类. :param file_path: 生成的html文件路径. :p
cpca/drawer.py:95
Function
echarts_draw
生成地域分布的echarts热力图的html文件. :param adcodes: 地址集 :param file_path: 生成的html文件路径. :param title: 图表的标题 :param subtitle: 图表的子标题
cpca/drawer.py:60
Function
empty
(res, rank, pos)
cpca/__init__.py:165
Method
finalize_options
(self)
setup.py:21
Method
initialize_options
(self)
setup.py:12
Function
mock_map
(monkeypatch, attrname, return_value, is_contain = True, is_unique_value = True)
tests/test_cpca.py:80
Method
run_tests
(self)
setup.py:26
Method
setup_class
(cls)
tests/test_structures.py:15
Method
setup_class
(cls)
tests/test_structures.py:49
Function
test_draw_locations
使用folium绘制热力图
tests/test_drawer.py:10
Function
test_echarts_cate_draw
使用echarts绘制分类散点图
tests/test_drawer.py:21
Function
test_echarts_draw
使用echarts绘制热力图
tests/test_drawer.py:15
Method
test_get_full_name
(self)
tests/test_structures.py:22
Method
test_get_relational_addrs
(self)
tests/test_structures.py:26
Method
test_get_value
(self)
tests/test_structures.py:38
Method
test_in
(self)
tests/test_structures.py:30
Function
test_init_data
()
tests/test_cpca.py:9
Method
test_is_unique_value
(self)
tests/test_structures.py:33
Function
test_matcher
()
tests/test_matcher.py:6
Method
test_propertys_dict
(self)
tests/test_structures.py:67
Method
test_province
(self)
tests/test_structures.py:62
Function
test_transform
()
tests/test_cpca.py:30
Function
test_transform_text_with_addrs
()
tests/test_cpca.py:56
Function
test_umap
()
tests/test_cpca.py:49
Function
transform
将地址描述字符串转换以"省","市","区"信息为列的DataFrame表格 Args: locations:地址描述字符集合,可以是list, Series等任意可以进行for in循环的集合 比如:["徐汇区虹漕
cpca/__init__.py:90
Function
transform_text_with_addrs
将含有多个地址的长文本中的地址全部提取出来 Args: text_with_addrs: 一个字符串,里面可能含有多个地址 index:可以通过这个参数指定输出的DataFrame的index,默认情况下是range(len(da
cpca/__init__.py:119