Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49cfcee

Browse files
committed
1
1 parent 6d58ee4 commit 49cfcee

File tree

4 files changed

+226
-32
lines changed

4 files changed

+226
-32
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 21,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"data": {
10+
"text/plain": [
11+
"array([[[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n",
12+
" [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]],\n",
13+
"\n",
14+
" [[20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\n",
15+
" [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]],\n",
16+
"\n",
17+
" [[40, 41, 42, 43, 44, 45, 46, 47, 48, 49],\n",
18+
" [50, 51, 52, 53, 54, 55, 56, 57, 58, 59]],\n",
19+
"\n",
20+
" [[60, 61, 62, 63, 64, 65, 66, 67, 68, 69],\n",
21+
" [70, 71, 72, 73, 74, 75, 76, 77, 78, 79]],\n",
22+
"\n",
23+
" [[80, 81, 82, 83, 84, 85, 86, 87, 88, 89],\n",
24+
" [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]]])"
25+
]
26+
},
27+
"execution_count": 21,
28+
"metadata": {},
29+
"output_type": "execute_result"
30+
}
31+
],
32+
"source": [
33+
"import numpy as np\n",
34+
"a = np.arange(100).reshape(5,2,10)\n",
35+
"a"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 30,
41+
"metadata": {},
42+
"outputs": [
43+
{
44+
"data": {
45+
"text/plain": [
46+
"array([ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
47+
" 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,\n",
48+
" 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,\n",
49+
" 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,\n",
50+
" 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,\n",
51+
" 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,\n",
52+
" 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,\n",
53+
" 96, 97, 98, 99, 100, 101, 102, 103, 104])"
54+
]
55+
},
56+
"execution_count": 30,
57+
"metadata": {},
58+
"output_type": "execute_result"
59+
}
60+
],
61+
"source": [
62+
"import numpy as np\n",
63+
"a = np.arange(100)+5\n",
64+
"a"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": null,
70+
"metadata": {},
71+
"outputs": [],
72+
"source": []
73+
}
74+
],
75+
"metadata": {
76+
"kernelspec": {
77+
"display_name": "Python 3",
78+
"language": "python",
79+
"name": "python3"
80+
},
81+
"language_info": {
82+
"codemirror_mode": {
83+
"name": "ipython",
84+
"version": 3
85+
},
86+
"file_extension": ".py",
87+
"mimetype": "text/x-python",
88+
"name": "python",
89+
"nbconvert_exporter": "python",
90+
"pygments_lexer": "ipython3",
91+
"version": "3.7.4"
92+
}
93+
},
94+
"nbformat": 4,
95+
"nbformat_minor": 2
96+
}

.ipynb_checkpoints/Week5_Ligang_Zhang-checkpoint.ipynb

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,37 +231,38 @@
231231
},
232232
{
233233
"cell_type": "code",
234-
"execution_count": 2,
234+
"execution_count": 240,
235235
"metadata": {},
236236
"outputs": [
237237
{
238-
"ename": "IndentationError",
239-
"evalue": "unexpected indent (<ipython-input-2-c7ff298c729d>, line 2)",
240-
"output_type": "error",
241-
"traceback": [
242-
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-2-c7ff298c729d>\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m f = urllib.request.urlopen(a_url)\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unexpected indent\n"
238+
"name": "stdout",
239+
"output_type": "stream",
240+
"text": [
241+
"https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no=06803495&referred_module=sw&period=&begin_date=2000-10-1&end_date=2019-9-30\n"
243242
]
244243
}
245244
],
246245
"source": [
247-
"import urllib.request.urlopen\n",
248-
" f = urllib.request.urlopen(a_url)\n",
249-
" lines = f.readlines()\n",
246+
"#import urllib.request.urlopen\n",
247+
" #f = urllib.request.urlopen(a_url)\n",
248+
" #lines = f.readlines()\n",
250249
"\n",
250+
"gages = '{}'.format('06803495')\n",
251+
" \n",
251252
"#begin date 2000-10-1, end date 2019-9-30\n",
252253
"begin_date = '2000-10-1'\n",
253254
"end_date = '2019-9-30'\n",
254-
"f'https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no=06803495&referred_module=sw&period=&begin_date={begin_date}&end_date={end_date}'\n",
255+
"print(f'https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no={gages}&referred_module=sw&period=&begin_date={begin_date}&end_date={end_date}')\n",
255256
" \n",
256257
"\n",
257258
" \n",
258259
" \n",
259-
"i = 0\n",
260-
"for line in f:\n",
261-
" i += 1\n",
262-
" print_line(line)\n",
263-
" if i == 27:\n",
264-
" break"
260+
"#i = 0\n",
261+
"#for line in f:\n",
262+
"# i += 1\n",
263+
"# print_line(line)\n",
264+
"# if i == 27:\n",
265+
"# break"
265266
]
266267
},
267268
{

Untitled.ipynb

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 21,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"data": {
10+
"text/plain": [
11+
"array([[[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],\n",
12+
" [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]],\n",
13+
"\n",
14+
" [[20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\n",
15+
" [30, 31, 32, 33, 34, 35, 36, 37, 38, 39]],\n",
16+
"\n",
17+
" [[40, 41, 42, 43, 44, 45, 46, 47, 48, 49],\n",
18+
" [50, 51, 52, 53, 54, 55, 56, 57, 58, 59]],\n",
19+
"\n",
20+
" [[60, 61, 62, 63, 64, 65, 66, 67, 68, 69],\n",
21+
" [70, 71, 72, 73, 74, 75, 76, 77, 78, 79]],\n",
22+
"\n",
23+
" [[80, 81, 82, 83, 84, 85, 86, 87, 88, 89],\n",
24+
" [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]]])"
25+
]
26+
},
27+
"execution_count": 21,
28+
"metadata": {},
29+
"output_type": "execute_result"
30+
}
31+
],
32+
"source": [
33+
"import numpy as np\n",
34+
"a = np.arange(100).reshape(5,2,10)\n",
35+
"a"
36+
]
37+
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 30,
41+
"metadata": {},
42+
"outputs": [
43+
{
44+
"data": {
45+
"text/plain": [
46+
"array([ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
47+
" 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,\n",
48+
" 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,\n",
49+
" 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,\n",
50+
" 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,\n",
51+
" 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,\n",
52+
" 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,\n",
53+
" 96, 97, 98, 99, 100, 101, 102, 103, 104])"
54+
]
55+
},
56+
"execution_count": 30,
57+
"metadata": {},
58+
"output_type": "execute_result"
59+
}
60+
],
61+
"source": [
62+
"import numpy as np\n",
63+
"a = np.arange(100)+5\n",
64+
"a"
65+
]
66+
},
67+
{
68+
"cell_type": "code",
69+
"execution_count": null,
70+
"metadata": {},
71+
"outputs": [],
72+
"source": []
73+
}
74+
],
75+
"metadata": {
76+
"kernelspec": {
77+
"display_name": "Python 3",
78+
"language": "python",
79+
"name": "python3"
80+
},
81+
"language_info": {
82+
"codemirror_mode": {
83+
"name": "ipython",
84+
"version": 3
85+
},
86+
"file_extension": ".py",
87+
"mimetype": "text/x-python",
88+
"name": "python",
89+
"nbconvert_exporter": "python",
90+
"pygments_lexer": "ipython3",
91+
"version": "3.7.4"
92+
}
93+
},
94+
"nbformat": 4,
95+
"nbformat_minor": 2
96+
}

Week5_Ligang_Zhang.ipynb

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -231,37 +231,38 @@
231231
},
232232
{
233233
"cell_type": "code",
234-
"execution_count": 2,
234+
"execution_count": 240,
235235
"metadata": {},
236236
"outputs": [
237237
{
238-
"ename": "IndentationError",
239-
"evalue": "unexpected indent (<ipython-input-2-c7ff298c729d>, line 2)",
240-
"output_type": "error",
241-
"traceback": [
242-
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-2-c7ff298c729d>\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m f = urllib.request.urlopen(a_url)\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m unexpected indent\n"
238+
"name": "stdout",
239+
"output_type": "stream",
240+
"text": [
241+
"https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no=06803495&referred_module=sw&period=&begin_date=2000-10-1&end_date=2019-9-30\n"
243242
]
244243
}
245244
],
246245
"source": [
247-
"import urllib.request.urlopen\n",
248-
" f = urllib.request.urlopen(a_url)\n",
249-
" lines = f.readlines()\n",
246+
"#import urllib.request.urlopen\n",
247+
" #f = urllib.request.urlopen(a_url)\n",
248+
" #lines = f.readlines()\n",
250249
"\n",
250+
"gages = '{}'.format('06803495')\n",
251+
" \n",
251252
"#begin date 2000-10-1, end date 2019-9-30\n",
252253
"begin_date = '2000-10-1'\n",
253254
"end_date = '2019-9-30'\n",
254-
"f'https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no=06803495&referred_module=sw&period=&begin_date={begin_date}&end_date={end_date}'\n",
255+
"print(f'https://waterdata.usgs.gov/nwis/dv?&cb_00060=on&format=rdb&site_no={gages}&referred_module=sw&period=&begin_date={begin_date}&end_date={end_date}')\n",
255256
" \n",
256257
"\n",
257258
" \n",
258259
" \n",
259-
"i = 0\n",
260-
"for line in f:\n",
261-
" i += 1\n",
262-
" print_line(line)\n",
263-
" if i == 27:\n",
264-
" break"
260+
"#i = 0\n",
261+
"#for line in f:\n",
262+
"# i += 1\n",
263+
"# print_line(line)\n",
264+
"# if i == 27:\n",
265+
"# break"
265266
]
266267
},
267268
{

0 commit comments

Comments
 (0)