I'm interested in things related to maps, so I tried using a package called "japanmap".
The procedure is as follows. Google colab does not have japanmap installed by default, so you will need to install japanmap again every time you create a new notebook.
--Install japanmap (implement only the first time) --First installation --Second installation
――Run and see how many yesterday
japanmap_01.py
#Install the required package(Conduct only once)
#!pip install japanmap
from japanmap import pref_names
from japanmap import pref_code
from japanmap import groups
from japanmap import is_faced2sea
from japanmap import adjacent
from japanmap import pref_map
from japanmap import get_data, pref_points
#Kanto region
for i in groups['Kanto']:
print(pref_names[i], is_faced2sea(i))
print()
#adjacent
for i in [2, 20]:
print(pref_names[i], ':', ' '.join([pref_names[j] for j in adjacent(i)]))
#Boundary data(svg)
qpqo = get_data()
svg = pref_map(range(1,48), qpqo=qpqo, width=2.5)
svg
--Result of execution
Recommended Posts