Japan prefecture names and codes
Project description
Japan information
Japan prefecture names and codes
Install
pip install jp_pref
How to use
import pandas as pd
from jp_pref.prefecture import df, name2code, code2name
Dataframe
Dataframe of prefecture names and codes
df
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
| name | short_name | |
|---|---|---|
| code | ||
| 1 | 北海道 | 北海 |
| 2 | 青森県 | 青森 |
| 3 | 岩手県 | 岩手 |
| 4 | 宮城県 | 宮城 |
| 5 | 秋田県 | 秋田 |
| 6 | 山形県 | 山形 |
| 7 | 福島県 | 福島 |
| 8 | 茨城県 | 茨城 |
| 9 | 栃木県 | 栃木 |
| 10 | 群馬県 | 群馬 |
| 11 | 埼玉県 | 埼玉 |
| 12 | 千葉県 | 千葉 |
| 13 | 東京都 | 東京 |
| 14 | 神奈川県 | 神奈川 |
| 15 | 新潟県 | 新潟 |
| 16 | 富山県 | 富山 |
| 17 | 石川県 | 石川 |
| 18 | 福井県 | 福井 |
| 19 | 山梨県 | 山梨 |
| 20 | 長野県 | 長野 |
| 21 | 岐阜県 | 岐阜 |
| 22 | 静岡県 | 静岡 |
| 23 | 愛知県 | 愛知 |
| 24 | 三重県 | 三重 |
| 25 | 滋賀県 | 滋賀 |
| 26 | 京都府 | 京都 |
| 27 | 大阪府 | 大阪 |
| 28 | 兵庫県 | 兵庫 |
| 29 | 奈良県 | 奈良 |
| 30 | 和歌山県 | 和歌山 |
| 31 | 鳥取県 | 鳥取 |
| 32 | 島根県 | 島根 |
| 33 | 岡山県 | 岡山 |
| 34 | 広島県 | 広島 |
| 35 | 山口県 | 山口 |
| 36 | 徳島県 | 徳島 |
| 37 | 香川県 | 香川 |
| 38 | 愛媛県 | 愛媛 |
| 39 | 高知県 | 高知 |
| 40 | 福岡県 | 福岡 |
| 41 | 佐賀県 | 佐賀 |
| 42 | 長崎県 | 長崎 |
| 43 | 熊本県 | 熊本 |
| 44 | 大分県 | 大分 |
| 45 | 宮崎県 | 宮崎 |
| 46 | 鹿児島県 | 鹿児島 |
| 47 | 沖縄県 | 沖縄 |
name2code() & code2name()
都道府県名の文字列、リスト、もしくは pandas series をコードに変換
name2code("東京都")
13
code2name(13)
'東京都'
name2code(["東京都", "大阪府", "北海道"])
[13, 27, 1]
code2name([13, 27, 1])
['東京都', '大阪府', '北海道']
name2code(pd.Series(["東京都", "大阪府", "北海道"]))
0 13
1 27
2 1
dtype: int64
code2name(pd.Series([13, 27, 1]))
0 東京都
1 大阪府
2 北海道
dtype: object
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jp_pref-0.0.4.tar.gz
(11.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jp_pref-0.0.4.tar.gz.
File metadata
- Download URL: jp_pref-0.0.4.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3868f989f4177072289290bd6770977c2218bd8dae180df65dda74d27e2794fc
|
|
| MD5 |
06e997fddbc1720b4572d3e92b897ad4
|
|
| BLAKE2b-256 |
6ef1af9cdcf28b349639bc295d1f0698f9fe474df40d779c6f2fa1b080f86003
|
File details
Details for the file jp_pref-0.0.4-py3-none-any.whl.
File metadata
- Download URL: jp_pref-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d14fa1ea3d41151ed393dde0509ce8b93a9b5a73914e2ef8be6d93e6ceb9d57e
|
|
| MD5 |
b8770b64fdb423a5959991d8129726a0
|
|
| BLAKE2b-256 |
6cc0136eb518648e88687e0eb6223233e28f50f0f10c3fc5626767f475163b14
|