https://conda.io/docs/user-guide/tasks/manage-python.html
Creating a new environment and install the second Python version into it. To create the new environment for Python 2.7, in your Terminal window or an Anaconda Prompt, run:
conda create -n py27 python=2.7 anaconda
source activate py27
activate py27
退出环境: source deactivate py27
也可以使用 activate root
切回root环境
python --version
In [1]:
! python --version
pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/your registered email address here/your product key here/GraphLab-Create-License.tar.gz
pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/wangchengjun@nju.edu.cn/4972-65DF-8E02-816C-AB15-021C-EC1B-0367/GraphLab-Create-License.tar.gz
https://turi.com/learn/userguide/
GraphLab Create is a Python package that allows programmers to perform end-to-end large-scale data analysis and data product development.
Data ingestion and cleaning with SFrames. SFrame is an efficient disk-based tabular data structure that is not limited by RAM. This lets you scale your analysis and data processing to handle terabytes of data, even on your laptop.
Data exploration and visualization with GraphLab Canvas. GraphLab Canvas is a browser-based interactive GUI that allows you to explore tabular data, summary plots and statistics.
Network analysis with SGraph. SGraph is a disk-based graph data structure that stores vertices and edges in SFrames.
Predictive model development with machine learning toolkits. GraphLab Create includes several toolkits for quick prototyping with fast, scalable algorithms.
Production automation with data pipelines. Data pipelines allow you to assemble reusable code tasks into jobs and automatically run them on common execution environments (e.g. Amazon Web Services, Hadoop).
In [2]:
from graphlab import SGraph, Vertex, Edge
g = SGraph()
verts = [Vertex(0, attr={'breed': 'labrador'}),
Vertex(1, attr={'breed': 'labrador'}),
Vertex(2, attr={'breed': 'vizsla'})]
g = g.add_vertices(verts)
g = g.add_edges(Edge(1, 2))
print(g)
In [3]:
from graphlab import SGraph, Vertex, Edge
g = SGraph()
verts = [Vertex(0, attr={'breed': 'labrador'}),
Vertex(1, attr={'breed': 'labrador'}),
Vertex(2, attr={'breed': 'vizsla'})]
g = g.add_vertices(verts)
g = g.add_edges(Edge(1, 2))
print g
In [4]:
g.show()
In [5]:
from graphlab import SFrame,SGraph
edge_data = SFrame.read_csv('../data/bond_edges.csv')
#'https://static.turi.com/datasets/bond/bond_edges.csv')
g = SGraph()
g = g.add_edges(edge_data, src_field='src', dst_field='dst')
print(g)
In [3]:
vertex_data = SFrame.read_csv('https://static.turi.com/datasets/bond/bond_vertices.csv')
g = SGraph(vertices=vertex_data, edges=edge_data, vid_field='name',
src_field='src', dst_field='dst')
In [6]:
g.show(vlabel='id', highlight=['James Bond', 'Moneypenny'], \
arrows=True)