Skip to content

Commit b49f99c

Browse files
committed
🧹
1 parent 050355f commit b49f99c

File tree

1 file changed

+124
-109
lines changed

1 file changed

+124
-109
lines changed

reading/06-ibis-3.ipynb

Lines changed: 124 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
{
6464
"data": {
6565
"text/html": [
66-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">DatabaseTable: ibis_read_csv_7c4pueeglfflvievrwtdlx7wcu\n",
66+
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">DatabaseTable: ibis_read_csv_hq3yjgckubazzecvlvn55m5asm\n",
6767
" assessid string\n",
6868
" assessorid string\n",
6969
" stockid string\n",
@@ -85,7 +85,7 @@
8585
"</pre>\n"
8686
],
8787
"text/plain": [
88-
"DatabaseTable: ibis_read_csv_7c4pueeglfflvievrwtdlx7wcu\n",
88+
"DatabaseTable: ibis_read_csv_hq3yjgckubazzecvlvn55m5asm\n",
8989
" assessid string\n",
9090
" assessorid string\n",
9191
" stockid string\n",
@@ -153,21 +153,8 @@
153153
" <th>assessid</th>\n",
154154
" <th>assessorid</th>\n",
155155
" <th>stockid</th>\n",
156-
" <th>stocklong</th>\n",
157-
" <th>recorder</th>\n",
158156
" <th>daterecorded</th>\n",
159-
" <th>dateloaded</th>\n",
160157
" <th>assessyear</th>\n",
161-
" <th>assesssource</th>\n",
162-
" <th>contacts</th>\n",
163-
" <th>notes</th>\n",
164-
" <th>pdffile</th>\n",
165-
" <th>assess</th>\n",
166-
" <th>refpoints</th>\n",
167-
" <th>assessmethod</th>\n",
168-
" <th>assesscomments</th>\n",
169-
" <th>xlsfilename</th>\n",
170-
" <th>mostrecent</th>\n",
171158
" </tr>\n",
172159
" </thead>\n",
173160
" <tbody>\n",
@@ -176,131 +163,49 @@
176163
" <td>DFO-COD2J3KL-1959-2014-WATSON</td>\n",
177164
" <td>DFO</td>\n",
178165
" <td>COD2J3KL</td>\n",
179-
" <td>Atlantic cod Southern Labrador-Eastern Newfoun...</td>\n",
180-
" <td>WATSON</td>\n",
181166
" <td>2016-02-25</td>\n",
182-
" <td>2016-02-18</td>\n",
183167
" <td>1959-2014</td>\n",
184-
" <td>http://www.dfo-mpo.gc.ca/csas-sccs/publication...</td>\n",
185-
" <td>NULL</td>\n",
186-
" <td>NULL</td>\n",
187-
" <td>NULL</td>\n",
188-
" <td>1</td>\n",
189-
" <td>1</td>\n",
190-
" <td>SURBA</td>\n",
191-
" <td>NULL</td>\n",
192-
" <td>WATSON_COD2J3KL_2014-DH-edited.xlsx</td>\n",
193-
" <td>0</td>\n",
194168
" </tr>\n",
195169
" <tr>\n",
196170
" <th>1</th>\n",
197171
" <td>DFO-NFLD-COD2J3KL-1850-2011-CHING</td>\n",
198172
" <td>DFO-NFLD</td>\n",
199173
" <td>COD2J3KL</td>\n",
200-
" <td>Atlantic cod Southern Labrador-Eastern Newfoun...</td>\n",
201-
" <td>CHING</td>\n",
202174
" <td>2013-10-22</td>\n",
203-
" <td>2001-12-31</td>\n",
204175
" <td>1850-2011</td>\n",
205-
" <td>NULL</td>\n",
206-
" <td>NULL</td>\n",
207-
" <td>NULL</td>\n",
208-
" <td>Stock Assesment of Northern (2J3KL) Cod in 2013</td>\n",
209-
" <td>1</td>\n",
210-
" <td>1</td>\n",
211-
" <td>SURBA</td>\n",
212-
" <td>NULL</td>\n",
213-
" <td>/home/srdbadmin/srdb/spreadsheets/CHING-COD2J3...</td>\n",
214-
" <td>0</td>\n",
215176
" </tr>\n",
216177
" <tr>\n",
217178
" <th>2</th>\n",
218179
" <td>DFO-NFLD-COD2J3KL-1959-2018-ASHBROOK</td>\n",
219180
" <td>DFO-NFLD</td>\n",
220181
" <td>COD2J3KL</td>\n",
221-
" <td>Atlantic cod Southern Labrador-Eastern Newfoun...</td>\n",
222-
" <td>ASHBROOK</td>\n",
223182
" <td>2019-06-20</td>\n",
224-
" <td>2019-08-22</td>\n",
225183
" <td>1959-2018</td>\n",
226-
" <td>http://www.dfo-mpo.gc.ca/csas-sccs/Publication...</td>\n",
227-
" <td>NULL</td>\n",
228-
" <td>NULL</td>\n",
229-
" <td>AtlanticCod.2J3KL.pdf</td>\n",
230-
" <td>1</td>\n",
231-
" <td>1</td>\n",
232-
" <td>ICA</td>\n",
233-
" <td>NULL</td>\n",
234-
" <td>ASHBROOK-COD2J3KL-2018-DH-edited.xlsx</td>\n",
235-
" <td>0</td>\n",
236184
" </tr>\n",
237185
" <tr>\n",
238186
" <th>3</th>\n",
239187
" <td>DFO-NFLD-COD2J3KL-1959-2021-HIVELY</td>\n",
240188
" <td>DFO-NFLD</td>\n",
241189
" <td>COD2J3KL</td>\n",
242-
" <td>Atlantic cod Southern Labrador-Eastern Newfoun...</td>\n",
243-
" <td>HIVELY</td>\n",
244190
" <td>2023-11-08</td>\n",
245-
" <td>2023-11-10</td>\n",
246191
" <td>1959-2021</td>\n",
247-
" <td>NULL</td>\n",
248-
" <td>NULL</td>\n",
249-
" <td>Science Advisory Report 2022/041</td>\n",
250-
" <td>NULL</td>\n",
251-
" <td>1</td>\n",
252-
" <td>1</td>\n",
253-
" <td>ICA</td>\n",
254-
" <td>NULL</td>\n",
255-
" <td>CND_vers4.62_updates.xlsx</td>\n",
256-
" <td>999</td>\n",
257192
" </tr>\n",
258193
" </tbody>\n",
259194
"</table>\n",
260195
"</div>"
261196
],
262197
"text/plain": [
263-
" assessid assessorid stockid \\\n",
264-
"0 DFO-COD2J3KL-1959-2014-WATSON DFO COD2J3KL \n",
265-
"1 DFO-NFLD-COD2J3KL-1850-2011-CHING DFO-NFLD COD2J3KL \n",
266-
"2 DFO-NFLD-COD2J3KL-1959-2018-ASHBROOK DFO-NFLD COD2J3KL \n",
267-
"3 DFO-NFLD-COD2J3KL-1959-2021-HIVELY DFO-NFLD COD2J3KL \n",
268-
"\n",
269-
" stocklong recorder daterecorded \\\n",
270-
"0 Atlantic cod Southern Labrador-Eastern Newfoun... WATSON 2016-02-25 \n",
271-
"1 Atlantic cod Southern Labrador-Eastern Newfoun... CHING 2013-10-22 \n",
272-
"2 Atlantic cod Southern Labrador-Eastern Newfoun... ASHBROOK 2019-06-20 \n",
273-
"3 Atlantic cod Southern Labrador-Eastern Newfoun... HIVELY 2023-11-08 \n",
274-
"\n",
275-
" dateloaded assessyear assesssource \\\n",
276-
"0 2016-02-18 1959-2014 http://www.dfo-mpo.gc.ca/csas-sccs/publication... \n",
277-
"1 2001-12-31 1850-2011 NULL \n",
278-
"2 2019-08-22 1959-2018 http://www.dfo-mpo.gc.ca/csas-sccs/Publication... \n",
279-
"3 2023-11-10 1959-2021 NULL \n",
280-
"\n",
281-
" contacts notes \\\n",
282-
"0 NULL NULL \n",
283-
"1 NULL NULL \n",
284-
"2 NULL NULL \n",
285-
"3 NULL Science Advisory Report 2022/041 \n",
286-
"\n",
287-
" pdffile assess refpoints \\\n",
288-
"0 NULL 1 1 \n",
289-
"1 Stock Assesment of Northern (2J3KL) Cod in 2013 1 1 \n",
290-
"2 AtlanticCod.2J3KL.pdf 1 1 \n",
291-
"3 NULL 1 1 \n",
292-
"\n",
293-
" assessmethod assesscomments \\\n",
294-
"0 SURBA NULL \n",
295-
"1 SURBA NULL \n",
296-
"2 ICA NULL \n",
297-
"3 ICA NULL \n",
198+
" assessid assessorid stockid daterecorded \\\n",
199+
"0 DFO-COD2J3KL-1959-2014-WATSON DFO COD2J3KL 2016-02-25 \n",
200+
"1 DFO-NFLD-COD2J3KL-1850-2011-CHING DFO-NFLD COD2J3KL 2013-10-22 \n",
201+
"2 DFO-NFLD-COD2J3KL-1959-2018-ASHBROOK DFO-NFLD COD2J3KL 2019-06-20 \n",
202+
"3 DFO-NFLD-COD2J3KL-1959-2021-HIVELY DFO-NFLD COD2J3KL 2023-11-08 \n",
298203
"\n",
299-
" xlsfilename mostrecent \n",
300-
"0 WATSON_COD2J3KL_2014-DH-edited.xlsx 0 \n",
301-
"1 /home/srdbadmin/srdb/spreadsheets/CHING-COD2J3... 0 \n",
302-
"2 ASHBROOK-COD2J3KL-2018-DH-edited.xlsx 0 \n",
303-
"3 CND_vers4.62_updates.xlsx 999 "
204+
" assessyear \n",
205+
"0 1959-2014 \n",
206+
"1 1850-2011 \n",
207+
"2 1959-2018 \n",
208+
"3 1959-2021 "
304209
]
305210
},
306211
"execution_count": 4,
@@ -311,6 +216,8 @@
311216
"source": [
312217
"(assessment\n",
313218
" .filter(_.stockid == \"COD2J3KL\")\n",
219+
" .select(_.assessid, _.assessorid, _.stockid,\n",
220+
" _.daterecorded, _.assessyear) # pick a subset of columns to focus on\n",
314221
" .execute()\n",
315222
")"
316223
]
@@ -457,10 +364,118 @@
457364
},
458365
{
459366
"cell_type": "code",
460-
"execution_count": null,
367+
"execution_count": 6,
461368
"id": "04dae269-5c92-4b10-affb-ce640dd9a585",
462369
"metadata": {},
463-
"outputs": [],
370+
"outputs": [
371+
{
372+
"data": {
373+
"text/html": [
374+
"<div>\n",
375+
"<style scoped>\n",
376+
" .dataframe tbody tr th:only-of-type {\n",
377+
" vertical-align: middle;\n",
378+
" }\n",
379+
"\n",
380+
" .dataframe tbody tr th {\n",
381+
" vertical-align: top;\n",
382+
" }\n",
383+
"\n",
384+
" .dataframe thead th {\n",
385+
" text-align: right;\n",
386+
" }\n",
387+
"</style>\n",
388+
"<table border=\"1\" class=\"dataframe\">\n",
389+
" <thead>\n",
390+
" <tr style=\"text-align: right;\">\n",
391+
" <th></th>\n",
392+
" <th>stockid</th>\n",
393+
" <th>n</th>\n",
394+
" </tr>\n",
395+
" </thead>\n",
396+
" <tbody>\n",
397+
" <tr>\n",
398+
" <th>0</th>\n",
399+
" <td>CODIIIaW-IV-VIId</td>\n",
400+
" <td>12</td>\n",
401+
" </tr>\n",
402+
" <tr>\n",
403+
" <th>1</th>\n",
404+
" <td>HADICE</td>\n",
405+
" <td>11</td>\n",
406+
" </tr>\n",
407+
" <tr>\n",
408+
" <th>2</th>\n",
409+
" <td>CODFAPL</td>\n",
410+
" <td>11</td>\n",
411+
" </tr>\n",
412+
" <tr>\n",
413+
" <th>3</th>\n",
414+
" <td>CODBA2224</td>\n",
415+
" <td>11</td>\n",
416+
" </tr>\n",
417+
" <tr>\n",
418+
" <th>4</th>\n",
419+
" <td>HERRRIGA</td>\n",
420+
" <td>11</td>\n",
421+
" </tr>\n",
422+
" <tr>\n",
423+
" <th>...</th>\n",
424+
" <td>...</td>\n",
425+
" <td>...</td>\n",
426+
" </tr>\n",
427+
" <tr>\n",
428+
" <th>1507</th>\n",
429+
" <td>SSALMLWASH</td>\n",
430+
" <td>1</td>\n",
431+
" </tr>\n",
432+
" <tr>\n",
433+
" <th>1508</th>\n",
434+
" <td>STROUT22-32</td>\n",
435+
" <td>1</td>\n",
436+
" </tr>\n",
437+
" <tr>\n",
438+
" <th>1509</th>\n",
439+
" <td>BLRAYVIIe</td>\n",
440+
" <td>1</td>\n",
441+
" </tr>\n",
442+
" <tr>\n",
443+
" <th>1510</th>\n",
444+
" <td>SGRAYVI-VII</td>\n",
445+
" <td>1</td>\n",
446+
" </tr>\n",
447+
" <tr>\n",
448+
" <th>1511</th>\n",
449+
" <td>PLAICIIIa</td>\n",
450+
" <td>1</td>\n",
451+
" </tr>\n",
452+
" </tbody>\n",
453+
"</table>\n",
454+
"<p>1512 rows × 2 columns</p>\n",
455+
"</div>"
456+
],
457+
"text/plain": [
458+
" stockid n\n",
459+
"0 CODIIIaW-IV-VIId 12\n",
460+
"1 HADICE 11\n",
461+
"2 CODFAPL 11\n",
462+
"3 CODBA2224 11\n",
463+
"4 HERRRIGA 11\n",
464+
"... ... ..\n",
465+
"1507 SSALMLWASH 1\n",
466+
"1508 STROUT22-32 1\n",
467+
"1509 BLRAYVIIe 1\n",
468+
"1510 SGRAYVI-VII 1\n",
469+
"1511 PLAICIIIa 1\n",
470+
"\n",
471+
"[1512 rows x 2 columns]"
472+
]
473+
},
474+
"execution_count": 6,
475+
"metadata": {},
476+
"output_type": "execute_result"
477+
}
478+
],
464479
"source": [
465480
"(assessment\n",
466481
" .group_by(_.stockid)\n",

0 commit comments

Comments
 (0)