博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Open restaurant using the business density report
阅读量:5752 次
发布时间:2019-06-18

本文共 3620 字,大约阅读时间需要 12 分钟。

Sometimes, we will confuse where to open a restaurant while we are rich enough. So, can we find the way to do the assessments? Of course, yes. So, let’s do it.

We will take “Shanghai” and “Tokyo” as our samples. Here is the information from wiki.

Shanghai is one of the four municipalities under the direct administration of the central government of China, the largest city in China by population, and the second most populous city proper in the world, with a population of more than 24 million as of 2017. It is a global financial centre and transport hub, with the world's busiest container port. Located in the Yangtze River Delta, it sits on the south edge of the estuary of the Yangtze in the middle portion of the East China coast. The municipality borders the provinces of Jiangsu and Zhejiang to the north, south and west, and is bounded to the east by the East China Sea.
Tokyo, officially Tokyo Metropolis, one of the 47 prefectures of Japan, has served as the Japanese capital since 1869.As of 2014 the Greater Tokyo Area ranked as the most populous metropolitan area in the world. The urban area houses the seat of the Emperor of Japan, of the Japanese government and of the National Diet. Tokyo forms part of the Kantō region on the southeastern side of Japan's main island, Honshu, and includes the Izu Islands and Ogasawara Islands.Tokyo was formerly named Edo when Shōgun Tokugawa Ieyasu made the city as his headquarters in 1603. It became the capital after Emperor Meiji moved his seat to the city from Kyoto in 1868; at that time Edo was renamed Tokyo. Tokyo Metropolis formed in 1943 from the merger of the former Tokyo Prefecture and the city of Tokyo.

So, next, we will find the useful data of the two cities.

We need to use google map to find the city's location data
We need to use the foursquare venues data to make samples
We need to use DBSCAN algorithm to make labels from the matrix sample which from foursquare venues data.
We need to use the folium map data to do the visualization

And we use Python as our program language.

Here we go.

Import all the libraries and functions

Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Get the location of Shanghai and Tokyo
Open restaurant using the business density report

Make the map to display the two cities

Open restaurant using the business density report
Open restaurant using the business density report

Define the ID of the foursquare API

Open restaurant using the business density report

Open restaurant using the business density report

Get the venues of shanghai

Open restaurant using the business density report

Create the map of Shanghai with venues

Open restaurant using the business density report
Open restaurant using the business density report

Get the location of each venues, then the dataframe as the sample matrix

Open restaurant using the business density report

Using the DBSCAN module to cluster

Open restaurant using the business density report

Check the labels

Open restaurant using the business density report
We can get the business density of Shanghai is 0.89.

Marked in the map

Open restaurant using the business density report
Open restaurant using the business density report

Repeat the actions for Tokyo city.

Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
Open restaurant using the business density report
We can get the business density of Tokyo is 0.86.

Open restaurant using the business density report

Open restaurant using the business density report

Result

From the labels, we can know the Shanghai’s business density is 0.89 > Tokyo’s business density 0.86. So, I will choose Shanghai to open a restaurant from the business density data.

Discussion

But business density is only one point of opening restaurant, we should consult more points such as population density, consumption index and so on. Because I can't get the data, so I only use business density to describe the problem.

Conclusion

So, if base on the foursquare venues data, I will use business density to find the city to open a restaurant. So, I will open the restaurant in Shanghai City of China.

Remark:

  1. I have put my whole scripts to git hub, here is the linkage:
  2. Shanghai information from wiki linkage:
  3. Tokyo information from wiki linkage:
  4. DBSCAN algorithm from wiki linkage:
  5. Folium Map from GitHub linkage:
  6. Shanghai food information from foursquare linkage:
    Open restaurant using the business density report
  7. Shanghai food information from foursquare linkage:
    Open restaurant using the business density report

Hope you will like it. Thank you.

--Willson Luo(罗崇锦) from China.

--2018/11/18

转载于:https://blog.51cto.com/10264683/2318424

你可能感兴趣的文章
dotConnect for Oracle入门指南(六):使用事务
查看>>
Pycharm上Django的使用 Day 1
查看>>
CSS:五环
查看>>
Python进阶:自定义对象实现切片功能
查看>>
PHP 发送电子邮件
查看>>
死磕 java集合之ArrayBlockingQueue源码分析
查看>>
Learn Python The Hard Way(18)
查看>>
scrollTop 用法说明
查看>>
OSChina 周三乱弹 ——程序员、魔法师和麻瓜
查看>>
OSChina 周二乱弹 —— 我妈都觉得我是个病毒
查看>>
jodd mvc框架 madvoc 教程(10):手工注册
查看>>
Json概述以及python对json的相关操作
查看>>
H264(NAL简介与I帧判断)
查看>>
Android之UI学习篇九:使用TabHost实现卡片选项菜单
查看>>
前端的那些事之移动端--基础
查看>>
使用开发人员工具来查看请求和响应
查看>>
修改window下的mysql数据库的密码
查看>>
线上环境数据库连接超时原因
查看>>
/etc/security/limits.conf
查看>>
Android支持的音频格式
查看>>