[PYTHON] The case where Tokyo looked like a vomit in Chiba prefecture

When I was looking at the homepage of a company, a color-coded map of Kanto was drawn, but when I saw it, something

"Tokyo looked like a vomit in Chiba Prefecture"

However, exposing the homepage seemed like a bad idea, so I tried to express it in Python.

Color it by referring to Open Excel file in Python and color map map.

!pip install japanmap
Collecting japanmap
[?25l  Downloading https://files.pythonhosted.org/packages/6c/49/2b29122d76a631984df2ebebead802f4e5752e33fe3478ccec2a2e4073da/japanmap-0.0.21.tar.gz (167kB)
      |████████████████████████████████| 174kB 2.8MB/s 
[?25hRequirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from japanmap) (1.17.5)
Requirement already satisfied: opencv-python in /usr/local/lib/python3.6/dist-packages (from japanmap) (4.1.2.30)
Requirement already satisfied: Pillow in /usr/local/lib/python3.6/dist-packages (from japanmap) (6.2.2)
Building wheels for collected packages: japanmap
  Building wheel for japanmap (setup.py) ... [?25l[?25hdone
  Created wheel for japanmap: filename=japanmap-0.0.21-cp36-none-any.whl size=166793 sha256=2f5cc7c0ed321acf04cb8eb976225ec82e4087e9c11a72f490cfd942f128bf71
  Stored in directory: /root/.cache/pip/wheels/a0/7b/2b/331437760ae95113fa973e5ad7af111588ce9c7e76feb14f56
Successfully built japanmap
Installing collected packages: japanmap
Successfully installed japanmap-0.0.21
%matplotlib inline
import matplotlib.pyplot as plt
from pylab import rcParams
from japanmap import pref_names,pref_code,picture

rcParams['figure.figsize'] = 12, 12
plt.imshow(picture({'Chiba':'red','Tokyo':(255, 219, 88)}))
<matplotlib.image.AxesImage at 0x7f7020586748>

output_4_1.png

How about that. Do you feel like that?

Recommended Posts

The case where Tokyo looked like a vomit in Chiba prefecture
The story of creating a store search BOT (AI LINE BOT) for Go To EAT in Chiba Prefecture (1)
When you make a mistake in the directory where you execute `pipenv install`
The story of creating a store search BOT (AI LINE BOT) for Go To EAT in Chiba Prefecture (2) [Overview]