Skip to content

Commit 9068023

Browse files
committed
add translated for 'Guessing mystery travel locations using Pandas, Docker and OS(R)M'
1 parent a8e920c commit 9068023

3 files changed

Lines changed: 32 additions & 39 deletions

File tree

‎Python Weekly/Python Weekly Issue 246.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ SortedContainers在大规模上运行得相当好。本文在理论和实践层
2929

3030
[使用Pandas, Docker和OS(R)M,猜测神秘的旅游地点](http://nbviewer.jupyter.org/gist/mhermans/8c32eea0d5ec29e6b4329acbe7f0d3de)
3131

32+
[中文版](../Science and Data Analysis/使用Pandas, Docker和OS(R)M来猜测神秘的旅行地.md)
33+
3234
[带django教程的Facebook聊天机器人,又名笑话机器人](https://codeexperiments.quora.com/Facebook-chat-bot-aka-joke-bot-with-django-tutorial)
3335

3436
[使用人工智能来评估手写数学公式](http://www.willforfang.com/computer-vision/2016/4/9/artificial-intelligence-for-handwritten-mathematical-expression-evaluation)

‎Science and Data Analysis/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
- [Matplotlib教程 - 绘制提到Trump, Clinton & Sanders的推特](./Matplotlib教程 - 绘制提到Trump, Clinton & Sanders的推特.md)
2525

2626
一篇手把手教你的Matplotlib教程,是一篇很不错的learn-by-doing的数据分析文章!!
27+
28+
- [使用Pandas, Docker和OS(R)M来猜测神秘的旅行地](./使用Pandas, Docker和OS(R)M来猜测神秘的旅行地.md)
29+
30+
如果你准备去某个神秘的地方玩,关于这个地方有几点提示,那么可以看看如何利用Pandas, Docker和OS(R)M科学有效的进行排除猜测。

raw/Guessing mystery travel locations using Pandas, Docker and OS(R)M.md renamed to Science and Data Analysis/使用Pandas, Docker和OS(R)M来猜测神秘的旅行地.md

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,26 @@
22

33
---
44

5-
In July we are travelling for a weekend to a mystery location. Some tips we
6-
have received:
5+
七月份的时候,我们要到一个神秘的地方旅行一个周末。我们收到了一些(关于这个神秘地点的)提示:
76

8-
* Three times an 'd' and three times an 'e' in the locations' name.
9-
* A good two hours travel eastwards from a given starting location (Heusden), which means it is in Germany.
10-
* Look at the lines between Worms, Koblenz, Aarlen, and Malmedy.
11-
* The symbols in the heraldic shield of the location refer to [Saint Jude](https://en.wikipedia.org/wiki/Jude_the_Apostle) and [Saint Simon](https://en.wikipedia.org/wiki/Simon_the_Zealot).
7+
* 这个地点名字里有3个'd'和3个'e'。
8+
* 从一个给定的起始点(Heusden)向东旅行需要花2个小时的实际,这意味着它在德国境内。
9+
* 看看在Worms, Koblenz, Aarlen, 和Malmedy之间的路线。
10+
* 该地的纹章盾中的符号指向[Saint Jude](https://en.wikipedia.org/wiki/Jude_the_Apostle) 和[Saint Simon](https://en.wikipedia.org/wiki/Simon_the_Zealot)。
1211

13-
To take a _very_ calculated guess at the location, we will
12+
要对这个地点进行一个_极具_计算性的猜测,我们要
1413

15-
1. Get all the German location names and their coordinates from [Open Street Map](https://www.openstreetmap.org/) (OSM).
16-
2. Filter the names on triple a's and triple e's.
17-
3. Calculate the effective driving time from the starting location to each of the matching locations using the webservice of the [Open Source Routing Machine](http://project-osrm.org/) (OSRM).
18-
4. Select those below 3h driving time, and near the intersection of the lines drawn from the four given cities.
19-
5. Look a the heraldic shields of the remaining locations.
14+
1. 从[Open Street Map](https://www.openstreetmap.org/) (OSM)中获得所有的德国地名及其坐标。
15+
2. 过滤掉名字不含3个d和3个e的。
16+
3. 使用[开源路由机(Open Source Routing Machine)](http://project-osrm.org/) (OSRM)的web服务计算从起始点到每个匹配地点的有效驾驶时间。
17+
4. 选取那些低于3小时驾驶时间,以及在给定的四个城市的交界处附近的地点。
18+
5. 看看所得结果的纹章盾。
2019

21-
## 1\. Get all the German placenames from OSM¶
20+
## 1. 从OSM获取所有的德国地名
2221

23-
To get a dump of OSM location names into Pandas for analysis, there is a very
24-
useful Github repository [OSMNames](https://github.com/geometalab/OSMNames)
25-
with Docker files and some scripts. It uses OSM data-dumps from [Geofabrik](http://nbviewer.jupyter.org/gist/mhermans/download.geofabrik.de/index.html), in
26-
our case the data available for
27-
[Germany](http://download.geofabrik.de/europe/germany.html).
22+
要将OSM地名转存储到Pandas以备分析,有一个非常有用的Github仓库[OSMNames](https://github.com/geometalab/OSMNames),它带有Docker文件和一些脚本。它使用来自[Geofabrik](http://nbviewer.jupyter.org/gist/mhermans/download.geofabrik.de/index.html)的OSM数据转储,在我们的例子中,该数据适用于[德国](http://download.geofabrik.de/europe/germany.html)。
2823

29-
We clone the Github repository and download the entire OSM-dataset for
30-
Germany:
24+
我们克隆Github仓库并下载整个关于德国的OSM数据集:
3125

3226
```python
3327

@@ -38,8 +32,7 @@ Germany:
3832

3933
```
4034

41-
Then we load the OSM-database dump using Docker to get our environment in a
42-
pinch, and export the German location names
35+
然后,使用Docker加载该OSM数据集转储,以在必要时获取我们的环境,并导出德国地名。
4336

4437
```python
4538

@@ -51,8 +44,7 @@ pinch, and export the German location names
5144

5245
```
5346

54-
For analysis, create a Python virtual environment, and install the required
55-
libraries with pip.
47+
为了进行分析,创建一个Python虚拟环境,并使用pip安装所需库。
5648

5749
```python
5850

@@ -62,15 +54,14 @@ libraries with pip.
6254

6355
```
6456

65-
Launch an interactive IPython notebook, you can download and re-run the one
66-
you are reading.
57+
加载一个交互式IPython notebook,你可以下载并重新运行所读取的那个。
6758

6859
```python
6960

7061
ipython notebook
7162
```
7263

73-
## 2\. Filter all the place names with triple 'a' and triple 'e'
64+
## 2. 过滤所有不带3个'd'和3个'e'的地名
7465

7566
In [1]:
7667

@@ -380,7 +371,7 @@ In [15]:
380371

381372
```
382373

383-
## 3\. Get the driving distance to all matches from OSRM¶
374+
## 3. 从OSRM中获取到所有匹配项的驾驶距离
384375

385376
In [16]:
386377

@@ -508,25 +499,21 @@ Seidfeld (Sauerland) | 191.1 | 109.9 | 180.5 | 63.9 | 0.0 | 63.8 | 179.3
508499
Siedlung Denrodtstraße | 171.1 | 90.6 | 160.1 | 47.2 | 62.5 | 0.0 | 132.0
509500
Heusden | 131.8 | 118.6 | 133.3 | 137.4 | 175.3 | 132.4 | 0.0
510501

511-
## 4\. Plot the crossing lines¶
502+
## 4. 绘制交叉线
512503

513-
Used R Leaflet for convenience, plus screenshot. Outer points are Worms,
514-
Koblenz, Aarlen, and Malmedy. Inner points are **Deudesfeld** and
515-
**Niederstadtfeld**, the rest are not that close to the intersection.
504+
为了方便,使用R Leaflet,加上截图。外部的点是Worms,
505+
Koblenz, Aarlen, 和Malmedy。里面的点是**Deudesfeld**和**Niederstadtfeld**,剩下的是不那么靠近交叉处的点。
516506

517507
![Image of Yaktocat](https://s33.postimg.org/kk7l6rc7z/germany_locations_lines.png)
518508

519-
## 5\. Verify the heraldic shiels of the final matches¶
509+
## 5. 确认最终匹配的纹章盾
520510

521-
The shield of [Deudesfeld](https://de.wikipedia.org/wiki/Deudesfeld) contains
522-
an axe and a woodcutters hatchet:
511+
[Deudesfeld](https://de.wikipedia.org/wiki/Deudesfeld)的盾牌包含一个斧头和一个樵夫斧头:
523512

524513
![Deudesfeld Weapon](https://upload.wikimedia.org/wikipedia/commons/thumb/6/62/Wappen_von_Deudesfeld.png/140px-Wappen_von_Deudesfeld.png)
525514

526-
A common attribute of Jude is an axe, given his death at the end of one. Simon
527-
is commonly depicted with a saw (sawn in half), or other woodworking tools
528-
such as a hatchet.
515+
Jude的共同属性是斧头,因为他死于其。Simon通常用锯(半锯),或者其他木工工具,例如斧,来描绘。
529516

530-
## Final verdict:¶
517+
## 最终判决
531518

532519
**Deudesfeld**

0 commit comments

Comments
 (0)