Recently, I summarized the basic usage of BI tool "Tableau" introduced as a set with AWS. Tableau is a very simple tool, so anyone who can use Excel can easily visualize the data.
August 3, 2019 Added Some information has been updated and re-edited and posted on my blog. Have a look at this. https://tadaken3.hatenablog.jp/entry/tableau-map
See also the following sites for "Tableau".
-[Tableau Official Website](http://get.tableau.com/ja-jp/trial/tableau-software.html?cid=70160000000YmmJ&ls=Paid%20Search&lsd=Google%20AdWords%20-%20Tableau%20-%20APAC % 20-% 20JP% 20-% 20Free% 20Trial & adgroup = Tableau% 20-% 20Brand% 20-% 20All & kw = tableau & adused = 54853941890 & distribution = search & gclid = Cj0KEQiA-NqyBRC905irsrLr-LUBEiQAWJFYTuwQDatz8JFYTuwQDatz -Summary of what you can do with Tableau Desktop -Introduction of Tableau Public ~ BI tool with excellent visualization that can be used on the Web ~ | Thinking about analysis environment
This time I'm using tableau Public, which can be used for free. It's almost the same functionality as the retail version of tableau Desktop. Click here for DL site ↓ https://public.tableau.com/s/
Using Python's Pandas module, Data is obtained from the "Population List by Prefecture" page of Wikipedia. ~~ (tableau public can only handle text files, so it outputs CSV files. With the product version, you can get the data directly from the DB) ~~
Starting with tableau 10.0, tableau public now supports Google Sheets and Web Data Connector. What's more, when Google Sheets is updated, it will be automatically updated by date and time processing. tableau public Too much beginning. (Addition: 2016-10-05)
import pandas as pd
url = 'https://ja.wikipedia.org/wiki/%E9%83%BD%E9%81%93%E5%BA%9C%E7%9C%8C%E3%81%AE%E4%BA%BA%E5%8F%A3%E4%B8%80%E8%A6%A7'
fetched_dataframes = pd.read_html(url, header = 0)
df = fetched_dataframes[0]
df.to_csv("population.csv", index = False,encoding='utf-8')
Launch tableau public and load the CSV file. No special settings are required. (It is a file called population.csv)
This time, I would like to calculate the population increase / decrease rate for each prefecture and visualize it on a map. First, we will calculate the population increase / decrease rate. I will enter the calculation formula like Excel. I haven't used it this time, but there are functions available, and it's really easy to calculate like Excel.
Since we want to use a map this time, specify "Geographical role" for the dimension "Prefecture". Since it is a tool in the United States, it is a "state", but if you specify this, it will recognize the prefectures of Japan properly.
If you double-click on a prefecture, "Tableau" will automatically recognize it and select the most suitable visual expression. In this case, the map is displayed because the geographical information is set. (Of course, you can also set it yourself.) This time, I want to express it in color by the population increase / decrease rate, so I will put the measure of the "population increase / decrease rate" created earlier in the mark part.
Select "Population Increase / Decrease Rate" and specify "Color". Then, each prefecture will be color-coded according to the population increase / decrease rate. Except for Kanto, it's almost bright red.
The rest is completed by supplementing with formats and comments. The completed file can be uploaded and published on the official tableau publlic website. It is like this.
Recommended Posts