File tree 2 files changed +29
-19
lines changed
2 files changed +29
-19
lines changed Original file line number Diff line number Diff line change 1
1
# Python Snippets
2
2
3
- These __ Python Snippets__ are tested with Python 3.5.x. (http://conda.pydata.org/ )
3
+ These __ Python Snippets__ are tested with Python 3.5.x. All snippets are
4
+ available as Jupyter notebooks (http://jupyter.org/ ).
5
+
4
6
5
7
## Get started...
6
8
To get started create a virtual environment and install the required packages.
7
- The following example shows how to create an environment with _ conda_ and Python 3.5 with
9
+
10
+ ### Virtualenv
11
+ The following example shows how to create an environment with
12
+ _ "virtualenv"_ (https://virtualenv.pypa.io/ )
13
+ and Python 3.5 with the required packages.
14
+
15
+ ``` bash
16
+ virtualenv --python=/usr/bin/python3.5 py35-ps
17
+
18
+ source py35-ps/bin/activate
19
+
20
+ pip install -r requirements.txt
21
+ ```
22
+
23
+ ### Conda
24
+ The following example shows how to create an environment with _ "conda"_
25
+ (http://conda.pydata.org/ ) and Python 3.5 with
8
26
the required packages.
9
27
10
28
``` bash
11
- conda create -n py35-ps python=3.5 -f requirements.txt
29
+ conda create -n py35-ps python=3.5
12
30
13
31
source activate py35-ps
14
32
15
33
pip install -r requirements.txt
16
34
```
17
35
18
- ## The snippets...
36
+ ## The Python Snippets
37
+ The snippets are organized by topic.
19
38
20
39
__ GeoJSON__
21
40
- [ GeoJSON Example - Stations] ( geojson/geojson_stations.ipynb )
Original file line number Diff line number Diff line change 5
5
"metadata" : {},
6
6
"source" : [
7
7
" # Parse a RSS feed with feedparser\n " ,
8
- " In this Python snippte we use the feedparser package to parse a RSS feed from 'Medium'. \n " ,
8
+ " In this Python snippet we use the feedparser package to parse a RSS feed from 'Medium'. \n " ,
9
9
" - https://medium.com/feed/tag/machine-learning"
10
10
]
11
11
},
112
112
" print('-->', urls[0], '\\ n')\n " ,
113
113
" "
114
114
]
115
- },
116
- {
117
- "cell_type" : " code" ,
118
- "execution_count" : null ,
119
- "metadata" : {
120
- "collapsed" : true
121
- },
122
- "outputs" : [],
123
- "source" : []
124
115
}
125
116
],
126
117
"metadata" : {
127
118
"kernelspec" : {
128
- "display_name" : " Python 3 " ,
119
+ "display_name" : " Python 2 " ,
129
120
"language" : " python" ,
130
- "name" : " python3 "
121
+ "name" : " python2 "
131
122
},
132
123
"language_info" : {
133
124
"codemirror_mode" : {
134
125
"name" : " ipython" ,
135
- "version" : 3
126
+ "version" : 2
136
127
},
137
128
"file_extension" : " .py" ,
138
129
"mimetype" : " text/x-python" ,
139
130
"name" : " python" ,
140
131
"nbconvert_exporter" : " python" ,
141
- "pygments_lexer" : " ipython3 " ,
142
- "version" : " 3.5.2 "
132
+ "pygments_lexer" : " ipython2 " ,
133
+ "version" : " 2.7.12 "
143
134
}
144
135
},
145
136
"nbformat" : 4 ,
You can’t perform that action at this time.
0 commit comments