{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "\n", "\n", "### 复旦大学新闻学院新媒体硕士课程\n", "***\n", "***\n", "# 使用folium做地图可视化\n", "***\n", "***\n", "\n", "王成军 \n", "\n", "wangchengjun@nju.edu.cn\n", "\n", "计算传播网 http://computational-communication.com\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/Users/chengjun/anaconda/lib/python2.7/site-packages/folium-0.3.0.dev0-py2.7.egg/folium/__init__.pyc\n", "0.3.0.dev\n" ] } ], "source": [ "import folium, jinja2, vincent\n", "from IPython.display import IFrame\n", "from IPython.core.display import HTML\n", "print(folium.__file__)\n", "print(folium.__version__)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# 读入数据" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "import pickle\n", "\n", "node_pkl = open('/Users/chengjun/GitHub/cjc2016/data/nodeLoc.pkl', 'rb')\n", "nodeLoc = pickle.load(node_pkl)\n", "node_pkl.close()\n", "\n", "edge_pkl = open('/Users/chengjun/GitHub/cjc2016/data/edgeLoc.pkl', 'rb')\n", "edgeLoc = pickle.load(edge_pkl)\n", "edge_pkl.close()" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# 绘制地图" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [ { "data": { "text/html": [ "