Open Tabs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Close All
Kernels
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Shut Down All
Recently Closed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Forget All
Workspaces
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Delete All
Terminals
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Shut Down All
lab_error_handling_exercices.ipynb
No Headings
The table of contents shows headings in notebooks and supported files.
Enter the quantity available for t-shirt: 10 +Enter the quantity available for mug: 12 +Enter the quantity available for hat: 10 +Enter the quantity available for book: 15 +Enter the quantity available for keychain: 11 +
Enter a product to order: hat +Do you want to add another product? (yes/no): no +
+Customer Orders:
+{'hat'}
++Order Statistics: +Total Products Ordered: 1 +Percentage of Products Ordered: 20.0% +
+Updated Inventory: +
t-shirt: 10 +mug: 12 +hat: 9 +book: 15 +keychain: 11 +
56.8 +
array([10, 20, 30, 50, 60])
array([0, 2, 4, 6, 8])
array([0., 0., 0., 0., 0.])
array([1., 1., 1., 1., 1.])
array([[1., 1., 1., 1.], + [1., 1., 1., 1.], + [1., 1., 1., 1.]])
([1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12])
10 +30 +50 +
[20 30 40] +
<class 'numpy.ndarray'> +
[20 30 40] +[10 20 30 40] +[30 40 50] +[10 30 50] +
mambajs 0.19.13 + +Process pip requirements ... + +Requirement numpy already handled by conda/micromamba/mamba. +
Cannot install 'pandas' from PyPI because it is a binary built package that is not compatible with WASM environments. To resolve this issue, you can: 1) Try to install it from emscripten-forge instead: "!mamba install pandas" 2) If that doesn't work, it's probably that the package was not made WASM-compatible on emscripten-forge. You can either request or contribute a new recipe for that package in https://github.com/emscripten-forge/recipes
--------------------------------------------------------------------------- +ModuleNotFoundError Traceback (most recent call last) +Cell In[29], line 2 + 1 import numpy as np +----> 2 import pandas as pd #it is convention to write it like this + +ModuleNotFoundError: No module named 'pandas'
We will collect electric vehicle sales data published on specialized websites in order to measure:
+market growth
+dominant brands
+best‑selling models
+This information will help anticipate future demand for charging stations.
+mambajs 0.21.1 + +Specs: xeus-python, numpy, matplotlib, pillow, ipywidgets>=8.1.6, ipyleaflet, scipy, pandas +Channels: emscripten-forge-4x, conda-forge + +Solving environment... +Solving took 1.1765 seconds + Name Version Build Channel +-------------------------------------------------------------------- ++ pandas 3.0.3 np23py313h1e705a5_0 emscripten-forge-4x ++ python-tzdata 2026.2 pyhd8ed1ab_0 conda-forge +- pip 26.1.2 pyh145f28c_0 conda-forge +
mambajs 0.21.1 + +Process pip requirements ... + +Requirement typing-extensions already satisfied. +Requirement pandas already handled by conda/micromamba/mamba. +Successfully installed requests-2.34.2 charset_normalizer-3.4.7 idna-3.18 urllib3-2.7.0 certifi-2026.6.17 beautifulsoup4-4.15.0 soupsieve-2.8.4 +
Emscripten-4.0.9-wasm32-32bit +
--------------------------------------------------------------------------- +JsGenericError Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/fetch.py:527, in send_request(request) + 525 js_xhr.setRequestHeader(name, value) +--> 527 js_xhr.send(to_js(request.body)) + 529 headers = dict(Parser().parsestr(js_xhr.getAllResponseHeaders())) + +File /lib/python3.13/site-packages/pyjs/extend_js_val.py:44, in extend_val.<locals>.<lambda>(self, *args) + 43 return future +---> 44 JsValue.__call__ = lambda self, *args: apply(self, args=args) + 45 JsValue._asstr_unsafe = lambda self: pyjs_core.internal.to_string(self) + +File /lib/python3.13/site-packages/pyjs/core.py:234, in apply(js_function, args) + 233 js_array_args, is_generated_proxy = _make_js_args(args) +--> 234 ret, meta = pyjs_core.internal.apply_try_catch(js_function, js_array_args, is_generated_proxy) + 235 return ret + +File /lib/python3.13/site-packages/pyjs/convert.py:251, in error_to_py_and_raise(err) + 250 def error_to_py_and_raise(err): +--> 251 raise error_to_py(err) + +JsGenericError: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://httpbin.org/get'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +During handling of the above exception, another exception occurred: + +_RequestError Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:123, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 122 if self._response is None: +--> 123 self._response = send_request(request) + 124 except _TimeoutError as e: + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/fetch.py:542, in send_request(request) + 541 elif err.name == "NetworkError": +--> 542 raise _RequestError(err.message, request=request) + 543 else: + 544 # general http error + +_RequestError: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://httpbin.org/get'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +The above exception was the direct cause of the following exception: + +HTTPException Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/connectionpool.py:788, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 787 # Make the request on the HTTPConnection object +--> 788 response = self._make_request( + 789 conn, + 790 method, + 791 url, + 792 timeout=timeout_obj, + 793 body=body, + 794 headers=headers, + 795 chunked=chunked, + 796 retries=retries, + 797 response_conn=response_conn, + 798 preload_content=preload_content, + 799 decode_content=decode_content, + 800 **response_kw, + 801 ) + 803 # Everything went great! + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:493, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) + 492 try: +--> 493 conn.request( + 494 method, + 495 url, + 496 body=body, + 497 headers=headers, + 498 chunked=chunked, + 499 preload_content=preload_content, + 500 decode_content=decode_content, + 501 enforce_content_length=enforce_content_length, + 502 ) + 504 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is + 505 # legitimately able to close the connection after sending a valid response. + 506 # With this behaviour, the received response is still readable. + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:127, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 126 except _RequestError as e: +--> 127 raise HTTPException(e.message) from e + +HTTPException: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://httpbin.org/get'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +During handling of the above exception, another exception occurred: + +ProtocolError Traceback (most recent call last) +File /lib/python3.13/site-packages/requests/adapters.py:696, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) + 695 try: +--> 696 resp = conn.urlopen( + 697 method=request.method, + 698 url=url, + 699 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] + 700 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 + 701 redirect=False, + 702 assert_same_host=False, + 703 preload_content=False, + 704 decode_content=False, + 705 retries=self.max_retries, + 706 timeout=resolved_timeout, + 707 chunked=chunked, + 708 ) + 710 except (ProtocolError, OSError) as err: + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:842, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 840 new_e = ProtocolError("Connection aborted.", new_e) +--> 842 retries = retries.increment( + 843 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] + 844 ) + 845 retries.sleep() + +File /lib/python3.13/site-packages/urllib3/util/retry.py:498, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) + 497 if read is False or method is None or not self._is_method_retryable(method): +--> 498 raise reraise(type(error), error, _stacktrace) + 499 elif read is not None: + +File /lib/python3.13/site-packages/urllib3/util/util.py:38, in reraise(tp, value, tb) + 37 if value.__traceback__ is not tb: +---> 38 raise value.with_traceback(tb) + 39 raise value + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:788, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 787 # Make the request on the HTTPConnection object +--> 788 response = self._make_request( + 789 conn, + 790 method, + 791 url, + 792 timeout=timeout_obj, + 793 body=body, + 794 headers=headers, + 795 chunked=chunked, + 796 retries=retries, + 797 response_conn=response_conn, + 798 preload_content=preload_content, + 799 decode_content=decode_content, + 800 **response_kw, + 801 ) + 803 # Everything went great! + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:493, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) + 492 try: +--> 493 conn.request( + 494 method, + 495 url, + 496 body=body, + 497 headers=headers, + 498 chunked=chunked, + 499 preload_content=preload_content, + 500 decode_content=decode_content, + 501 enforce_content_length=enforce_content_length, + 502 ) + 504 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is + 505 # legitimately able to close the connection after sending a valid response. + 506 # With this behaviour, the received response is still readable. + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:127, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 126 except _RequestError as e: +--> 127 raise HTTPException(e.message) from e + +ProtocolError: ('Connection aborted.', HTTPException('{"stack":"NetworkError: Failed to execute \'send\' on \'XMLHttpRequest\': Failed to load \'https://httpbin.org/get\'.\\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"}')) + +During handling of the above exception, another exception occurred: + +ConnectionError Traceback (most recent call last) +Cell In[10], line 3 + 1 import requests +----> 3 response = requests.get("https://httpbin.org/get") + 4 print(response.status_code) + +File /lib/python3.13/site-packages/requests/api.py:87, in get(url, params, **kwargs) + 74 def get( + 75 url: _t.UriType, params: _t.ParamsType = None, **kwargs: Unpack[_t.GetKwargs] + 76 ) -> Response: + 77 r"""Sends a GET request. + 78 + 79 :param url: URL for the new :class:`Request` object. + (...) 84 :rtype: requests.Response + 85 """ +---> 87 return request("get", url, params=params, **kwargs) + +File /lib/python3.13/site-packages/requests/api.py:71, in request(method, url, **kwargs) + 67 # By using the 'with' statement we are sure the session is closed, thus we + 68 # avoid leaving sockets open which can trigger a ResourceWarning in some + 69 # cases, and look like a memory leak in others. + 70 with sessions.Session() as session: +---> 71 return session.request(method=method, url=url, **kwargs) + +File /lib/python3.13/site-packages/requests/sessions.py:651, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) + 646 send_kwargs = { + 647 "timeout": timeout, + 648 "allow_redirects": allow_redirects, + 649 } + 650 send_kwargs.update(settings) +--> 651 resp = self.send(prep, **send_kwargs) + 653 return resp + +File /lib/python3.13/site-packages/requests/sessions.py:784, in Session.send(self, request, **kwargs) + 781 start = preferred_clock() + 783 # Send the request +--> 784 r = adapter.send(request, **kwargs) + 786 # Total elapsed time of the request (approximately) + 787 elapsed = preferred_clock() - start + +File /lib/python3.13/site-packages/requests/adapters.py:711, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) + 696 resp = conn.urlopen( + 697 method=request.method, + 698 url=url, + (...) 707 chunked=chunked, + 708 ) + 710 except (ProtocolError, OSError) as err: +--> 711 raise ConnectionError(err, request=request) + 713 except MaxRetryError as e: + 714 if isinstance(e.reason, ConnectTimeoutError): + 715 # TODO: Remove this in 3.0.0: see #2811 + +ConnectionError: ('Connection aborted.', HTTPException('{"stack":"NetworkError: Failed to execute \'send\' on \'XMLHttpRequest\': Failed to load \'https://httpbin.org/get\'.\\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"}'))
--------------------------------------------------------------------------- +JsGenericError Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/fetch.py:527, in send_request(request) + 525 js_xhr.setRequestHeader(name, value) +--> 527 js_xhr.send(to_js(request.body)) + 529 headers = dict(Parser().parsestr(js_xhr.getAllResponseHeaders())) + +File /lib/python3.13/site-packages/pyjs/extend_js_val.py:44, in extend_val.<locals>.<lambda>(self, *args) + 43 return future +---> 44 JsValue.__call__ = lambda self, *args: apply(self, args=args) + 45 JsValue._asstr_unsafe = lambda self: pyjs_core.internal.to_string(self) + +File /lib/python3.13/site-packages/pyjs/core.py:234, in apply(js_function, args) + 233 js_array_args, is_generated_proxy = _make_js_args(args) +--> 234 ret, meta = pyjs_core.internal.apply_try_catch(js_function, js_array_args, is_generated_proxy) + 235 return ret + +File /lib/python3.13/site-packages/pyjs/convert.py:251, in error_to_py_and_raise(err) + 250 def error_to_py_and_raise(err): +--> 251 raise error_to_py(err) + +JsGenericError: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://www.anfac.com/'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +During handling of the above exception, another exception occurred: + +_RequestError Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:123, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 122 if self._response is None: +--> 123 self._response = send_request(request) + 124 except _TimeoutError as e: + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/fetch.py:542, in send_request(request) + 541 elif err.name == "NetworkError": +--> 542 raise _RequestError(err.message, request=request) + 543 else: + 544 # general http error + +_RequestError: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://www.anfac.com/'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +The above exception was the direct cause of the following exception: + +HTTPException Traceback (most recent call last) +File /lib/python3.13/site-packages/urllib3/connectionpool.py:788, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 787 # Make the request on the HTTPConnection object +--> 788 response = self._make_request( + 789 conn, + 790 method, + 791 url, + 792 timeout=timeout_obj, + 793 body=body, + 794 headers=headers, + 795 chunked=chunked, + 796 retries=retries, + 797 response_conn=response_conn, + 798 preload_content=preload_content, + 799 decode_content=decode_content, + 800 **response_kw, + 801 ) + 803 # Everything went great! + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:493, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) + 492 try: +--> 493 conn.request( + 494 method, + 495 url, + 496 body=body, + 497 headers=headers, + 498 chunked=chunked, + 499 preload_content=preload_content, + 500 decode_content=decode_content, + 501 enforce_content_length=enforce_content_length, + 502 ) + 504 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is + 505 # legitimately able to close the connection after sending a valid response. + 506 # With this behaviour, the received response is still readable. + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:127, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 126 except _RequestError as e: +--> 127 raise HTTPException(e.message) from e + +HTTPException: {"stack":"NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://www.anfac.com/'.\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"} + +During handling of the above exception, another exception occurred: + +ProtocolError Traceback (most recent call last) +File /lib/python3.13/site-packages/requests/adapters.py:696, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) + 695 try: +--> 696 resp = conn.urlopen( + 697 method=request.method, + 698 url=url, + 699 body=request.body, # type: ignore[arg-type] # urllib3 stubs don't accept Iterable[bytes | str] + 700 headers=request.headers, # type: ignore[arg-type] # urllib3#3072 + 701 redirect=False, + 702 assert_same_host=False, + 703 preload_content=False, + 704 decode_content=False, + 705 retries=self.max_retries, + 706 timeout=resolved_timeout, + 707 chunked=chunked, + 708 ) + 710 except (ProtocolError, OSError) as err: + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:842, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 840 new_e = ProtocolError("Connection aborted.", new_e) +--> 842 retries = retries.increment( + 843 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] + 844 ) + 845 retries.sleep() + +File /lib/python3.13/site-packages/urllib3/util/retry.py:498, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) + 497 if read is False or method is None or not self._is_method_retryable(method): +--> 498 raise reraise(type(error), error, _stacktrace) + 499 elif read is not None: + +File /lib/python3.13/site-packages/urllib3/util/util.py:38, in reraise(tp, value, tb) + 37 if value.__traceback__ is not tb: +---> 38 raise value.with_traceback(tb) + 39 raise value + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:788, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) + 787 # Make the request on the HTTPConnection object +--> 788 response = self._make_request( + 789 conn, + 790 method, + 791 url, + 792 timeout=timeout_obj, + 793 body=body, + 794 headers=headers, + 795 chunked=chunked, + 796 retries=retries, + 797 response_conn=response_conn, + 798 preload_content=preload_content, + 799 decode_content=decode_content, + 800 **response_kw, + 801 ) + 803 # Everything went great! + +File /lib/python3.13/site-packages/urllib3/connectionpool.py:493, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) + 492 try: +--> 493 conn.request( + 494 method, + 495 url, + 496 body=body, + 497 headers=headers, + 498 chunked=chunked, + 499 preload_content=preload_content, + 500 decode_content=decode_content, + 501 enforce_content_length=enforce_content_length, + 502 ) + 504 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is + 505 # legitimately able to close the connection after sending a valid response. + 506 # With this behaviour, the received response is still readable. + +File /lib/python3.13/site-packages/urllib3/contrib/emscripten/connection.py:127, in EmscriptenHTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) + 126 except _RequestError as e: +--> 127 raise HTTPException(e.message) from e + +ProtocolError: ('Connection aborted.', HTTPException('{"stack":"NetworkError: Failed to execute \'send\' on \'XMLHttpRequest\': Failed to load \'https://www.anfac.com/\'.\\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"}')) + +During handling of the above exception, another exception occurred: + +ConnectionError Traceback (most recent call last) +Cell In[9], line 1 +----> 1 response = requests.get( + 2 url, + 3 headers=headers + 4 ) + 6 print(response.status_code) + +File /lib/python3.13/site-packages/requests/api.py:87, in get(url, params, **kwargs) + 74 def get( + 75 url: _t.UriType, params: _t.ParamsType = None, **kwargs: Unpack[_t.GetKwargs] + 76 ) -> Response: + 77 r"""Sends a GET request. + 78 + 79 :param url: URL for the new :class:`Request` object. + (...) 84 :rtype: requests.Response + 85 """ +---> 87 return request("get", url, params=params, **kwargs) + +File /lib/python3.13/site-packages/requests/api.py:71, in request(method, url, **kwargs) + 67 # By using the 'with' statement we are sure the session is closed, thus we + 68 # avoid leaving sockets open which can trigger a ResourceWarning in some + 69 # cases, and look like a memory leak in others. + 70 with sessions.Session() as session: +---> 71 return session.request(method=method, url=url, **kwargs) + +File /lib/python3.13/site-packages/requests/sessions.py:651, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) + 646 send_kwargs = { + 647 "timeout": timeout, + 648 "allow_redirects": allow_redirects, + 649 } + 650 send_kwargs.update(settings) +--> 651 resp = self.send(prep, **send_kwargs) + 653 return resp + +File /lib/python3.13/site-packages/requests/sessions.py:784, in Session.send(self, request, **kwargs) + 781 start = preferred_clock() + 783 # Send the request +--> 784 r = adapter.send(request, **kwargs) + 786 # Total elapsed time of the request (approximately) + 787 elapsed = preferred_clock() - start + +File /lib/python3.13/site-packages/requests/adapters.py:711, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) + 696 resp = conn.urlopen( + 697 method=request.method, + 698 url=url, + (...) 707 chunked=chunked, + 708 ) + 710 except (ProtocolError, OSError) as err: +--> 711 raise ConnectionError(err, request=request) + 713 except MaxRetryError as e: + 714 if isinstance(e.reason, ConnectTimeoutError): + 715 # TODO: Remove this in 3.0.0: see #2811 + +ConnectionError: ('Connection aborted.', HTTPException('{"stack":"NetworkError: Failed to execute \'send\' on \'XMLHttpRequest\': Failed to load \'https://www.anfac.com/\'.\\n at Module._apply_try_catch (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:1950)\\n at methodCaller<(emscripten::val, emscripten::val, emscripten::val) => emscripten::val> (eval at __emval_get_method_caller (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:222664), <anonymous>:7:17)\\n at __emval_call (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:220678)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17013]:0x6e353e\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[17012]:0x6e3419\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[16940]:0x6dd1df\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[270]:0x21eaf6\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)\\n at https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.wasm:wasm-function[18805]:0x78f3fc\\n at _PyEM_TrampolineCall_JavaScript (https://jupyter.org/try-jupyter/xeus/xeus-python-kernel/bin/xpython.js:7:628185)"}'))
--------------------------------------------------------------------------- +NameError Traceback (most recent call last) +Cell In[12], line 1 +----> 1 for div in all_divs: + 2 print(div.get("class")) + +NameError: name 'all_divs' is not defined
How many do you need? : 2 +How many do you need? : 3 +How many do you need? : 4 +How many do you need? : 5 +How many do you need? : 6 +
{'t-shirt': 2, 'mug': 3, 'hat': 4, 'book': 5, 'keychain': 6}
+select the product: hat +select the product: book +select the product: mug +
{'hat', 'mug', 'book'}
+(3, 60.0) +
+Order Statistics: +Total Products Ordered: 3 +Percentage of Products Ordered: 60.0% +
{'t-shirt': 1, 'mug': 2, 'hat': 3, 'book': 4, 'keychain': 5}
+t-shirt : 1 +mug : 2 +hat : 3 +book : 4 +keychain : 5 +
mambajs 0.21.1 + +Specs: xeus-python, numpy, matplotlib, pillow, ipywidgets>=8.1.6, ipyleaflet, scipy, pandas +Channels: emscripten-forge-4x, conda-forge + +Solving environment... +Solving took 1.3468000000044704 seconds + Name Version Build Channel +-------------------------------------------------------------------- ++ pandas 3.0.3 np23py313h1e705a5_0 emscripten-forge-4x ++ python-tzdata 2026.2 pyhd8ed1ab_0 conda-forge +- pip 26.1.2 pyh145f28c_0 conda-forge +
/drive/notebooks +
Emscripten-4.0.9-wasm32-32bit +
/drive/notebooks +
mambajs 0.21.1 + +Process pip requirements ... + +Successfully installed xlrd-2.0.2 +
Date Year Type Country State \ +0 24th May 2026.0 Unprovoked Australia Queensland +1 17th May 2026.0 Questionable USA Maryland +2 16th May 2026.0 Unprovoked Australia Western Australia +3 14th April 2026.0 UNprovoked Maldives Gaafu Alif Atoll +4 3rd April 2026.0 Unprovoked Australia South Australia + + Location Activity \ +0 Kennedy Shoal Spearfishing +1 Assateague State Park Surfing +2 Horseshoe Reef Rottnest Island Skindiving +3 Kooddoo Swimming +4 Middleton Beach Fleurieu Peninsula Adelaide Surfing + + Name Sex Age ... \ +0 Michael Jensz M 39 ... +1 Brendan Oster M ? ... +2 Steven Mattaboni M 38 ... +3 Not stated - on honeymoon M ? ... +4 Oliver Tokic-Bensley M 16 ... + + Species \ +0 Undetermined Bull shark most likely +1 Blue fish bite most probable +2 Great White Shark +3 Unknown +4 Bronze Whaler + + Source pdf href formula href \ +0 Simon de Marchi: 9 News: 7 News: ABC News: NaN NaN NaN +1 Keithe Cowley: Delmarva Now: NaN NaN NaN +2 ABC News: 9 News: 7 News: Simon De Marchi NaN NaN NaN +3 The U.S. Sun: Simon De Marchi NaN NaN NaN +4 ABC News: The Guardian: Andrew Currie and Bob... NaN NaN NaN + + Case Number Case Number.1 original order Unnamed: 21 Unnamed: 22 +0 NaN NaN NaN NaN NaN +1 NaN NaN NaN NaN NaN +2 NaN NaN NaN NaN NaN +3 NaN NaN NaN NaN NaN +4 NaN NaN NaN NaN NaN + +[5 rows x 23 columns] +
<class 'pandas.DataFrame'> +['Date', 'Year', 'Type', 'Country', 'State', 'Location', 'Activity', 'Name', 'Sex', 'Age', 'Injury', 'Fatal Y/N', 'Time', 'Species ', 'Source', 'pdf', 'href formula', 'href', 'Case Number', 'Case Number.1', 'original order', 'Unnamed: 21', 'Unnamed: 22'] +
| + | Country | +State | +Location | +
|---|---|---|---|
| 0 | +Australia | +Queensland | +Kennedy Shoal | +
| 1 | +USA | +Maryland | +Assateague State Park | +
| 2 | +Australia | +Western Australia | +Horseshoe Reef Rottnest Island | +
| 3 | +Maldives | +Gaafu Alif Atoll | +Kooddoo | +
| 4 | +Australia | +South Australia | +Middleton Beach Fleurieu Peninsula Adelaide | +
| 5 | +Bahamas | +Andros Island | +Fresh Creek | +
| 6 | +Australia | +South Australia | +Cape Jaffa Limestone Coast | +
| 7 | +Australia | +NSW | +Little Avalon Beach | +
| 8 | +USA | +California | +Big River Beach Mendocino County | +
| 9 | +Australia | +Western Australia | +Exmouth | +
| 10 | +Australia | +Western Australia | +Exmouth | +
| 11 | +Australia | +Queensland | +Lady Elliott Island | +
| 12 | +New Caledonia | +Noumea | +Anse Vata near Point Magnin | +
| 13 | +Cayman Islands | +Little Cayman Island | +Caribbean Sea | +
| 14 | +Brazil | +Recife | +Del Chifre Beach in Olinda | +
| 15 | +Australia | +NSW | +Angels Beach East Ballina | +
| 16 | +Australia | +Tasmania | +Cooee Beach west of Burnie | +
| 17 | +Australia | +NSW | +Point Plomber North of Port Macquarie | +
| 18 | +Australia | +NSW | +Dee Why | +
| 19 | +Australia | +NSW | +North Steyne | +
Country +UNITED STATES 2581 +AUSTRALIA 1531 +SOUTH AFRICA 599 +NEW ZEALAND 146 +BAHAMAS 142 +PAPUA NEW GUINEA 136 +BRAZIL 123 +MEXICO 107 +ITALY 72 +FIJI 70 +NEW CALEDONIA 68 +PHILIPPINES 65 +REUNION 60 +EGYPT 53 +MOZAMBIQUE 52 +CUBA 49 +SPAIN 47 +UNITED KINGDOM 44 +INDIA 41 +FRENCH POLYNESIA 40 +Name: count, dtype: int64
<Axes: xlabel='Country'>
State +Florida 1193 +New South Wales 539 +Queensland 356 +Hawaii 345 +California 328 +Western Australia 247 +Kwazulu-Natal 219 +Western Cape Province 197 +South Carolina 176 +Eastern Cape Province 168 +South Australia 122 +North Carolina 122 +Victoria 98 +Texas 83 +Pernambuco 80 +North Island 76 +Torres Strait 72 +New Jersey 57 +New York 48 +Tasmania 45 +Name: count, dtype: int64
State +Florida 18.07 +New South Wales 8.16 +Queensland 5.39 +Hawaii 5.22 +California 4.97 +Western Australia 3.74 +Kwazulu-Natal 3.32 +Western Cape Province 2.98 +South Carolina 2.67 +Eastern Cape Province 2.54 +South Australia 1.85 +North Carolina 1.85 +Victoria 1.48 +Texas 1.26 +Pernambuco 1.21 +North Island 1.15 +Torres Strait 1.09 +New Jersey 0.86 +New York 0.73 +Tasmania 0.68 +Name: proportion, dtype: float64
0 Kennedy Shoal +1 Assateague State Park +2 Horseshoe Reef Rottnest Island +3 Kooddoo +4 Middleton Beach Fleurieu Peninsula Adelaide +5 Fresh Creek +6 Cape Jaffa Limestone Coast +7 Little Avalon Beach +8 Big River Beach Mendocino County +9 Exmouth +10 Exmouth +11 Lady Elliott Island +12 Anse Vata near Point Magnin +13 Caribbean Sea +14 Del Chifre Beach in Olinda +15 Angels Beach East Ballina +16 Cooee Beach west of Burnie +17 Point Plomber North of Port Macquarie +18 Dee Why +19 North Steyne +Name: Location, dtype: str +
4588 +
567 +
np.int64(573)
0 Kennedy Shoal +1 Assateague State Park +2 Horseshoe Reef Rottnest Island +3 Kooddoo +4 Middleton Beach Fleurieu Peninsula Adelaide + ... +7085 Roebuck Bay +7086 NaN +7087 Ocracoke Inlet +7088 Panama Bay 8ºn, 79ºw +7089 Below The English Fort, Trincomalee +Name: Location, Length: 7090, dtype: str
4549
Location +New Smyrna Beach, Volusia County 198 +Daytona Beach, Volusia County 35 +Cocoa Beach, Brevard County 33 +Ponce Inlet, Volusia County 28 +Myrtle Beach, Horry County 22 +Melbourne Beach, Brevard County 21 +Isle Of Palms, Charleston County 18 +Durban 18 +Piedade 14 +Boa Viagem, Recife 14 +Jensen Beach, Martin County 13 +Jacksonville Beach, Duval County 13 +Ponce Inlet, New Smyrna Beach, Volusia County 13 +Juno Beach, Palm Beach County 12 +Ormond Beach, Volusia County 11 +Palm Beach, Palm Beach County 11 +Mossel Bay 11 +Ahvaz, On The Karun River 11 +New Smyrna Beach 10 +Florida Keys, Monroe County 10 +Name: count, dtype: int64
Time +Afternoon 263 +Morning 141 +11:00 140 +15:00 128 +16:00 126 +12:00 122 +14:00 117 +16:30 88 +13:00 87 +17:30 83 +17:00 81 +14:30 76 +11:30 75 +18:00 75 +10:00 74 +15:30 73 +13:30 70 +Night 64 +10:30 61 +09:00 61 +Name: count, dtype: int64
<StringDtype(storage='python', na_value=nan)>
4677 NaN +4985 NaN +632 14:00 +6780 NaN +2068 17:30 +1444 12:00 +2706 NaN +2467 03:00 +1161 19:30 +3491 09:45 +2166 Afternoon +2577 12:00 +3978 13:30 +2110 Afternoon +5517 14:00 +6466 NaN +5956 NaN +445 11:00 +1342 20:30 +5609 17:30 +Name: Time, dtype: str
Time +Afternoon 263 +Morning 141 +11:00 140 +15:00 128 +16:00 126 +12:00 122 +14:00 117 +16:30 88 +13:00 87 +17:30 83 +17:00 81 +14:30 76 +11:30 75 +18:00 75 +10:00 74 +15:30 73 +13:30 70 +Night 64 +10:30 61 +09:00 61 +Evening 45 +08:00 43 +12:30 42 +09:30 39 +18:30 36 +07:30 35 +08:30 34 +? 30 +07:00 28 +19:00 26 +Name: count, dtype: int64
np.int64(91)
np.int64(3)
np.int64(29)
np.int64(4211)
Index(['Date', 'Year', 'Type', 'Country', 'State', 'Location', 'Activity', + 'Name', 'Sex', 'Age', 'Injury', 'Fatal Y/N', 'Time', 'Species ', + 'Source', 'pdf', 'href formula', 'href', 'Case Number', 'Case Number.1', + 'original order', 'Unnamed: 21', 'Unnamed: 22', 'Hour', 'Time_Period', + 'Time_Clean'], + dtype='str') +
Index(['Date', 'Year', 'Type', 'Country', 'State', 'Location', 'Activity', + 'Name', 'Sex', 'Age', 'Injury', 'Fatal Y/N', 'Time', 'Species ', + 'Source', 'pdf', 'href formula', 'href', 'Case Number', 'Case Number.1', + 'original order', 'Unnamed: 21', 'Unnamed: 22', 'Hour', 'Time_Period', + 'Time_Clean'], + dtype='str') +
| + | Time | +Hour | +Time_Period | +
|---|---|---|---|
| 0 | +1100:00rs | +NaN | +1100:00rs | +
| 1 | +? | +NaN | +? | +
| 2 | +1000:00rs | +NaN | +1000:00rs | +
| 3 | +? | +NaN | +? | +
| 4 | +? | +NaN | +? | +
| 5 | +1730:00rs | +NaN | +1730:00rs | +
| 6 | +? | +NaN | +? | +
| 7 | +? | +NaN | +? | +
| 8 | +1715:00rs | +NaN | +1715:00rs | +
| 9 | +1015:00rs | +NaN | +1015:00rs | +
| 10 | +0800:00rs | +NaN | +0800:00rs | +
| 11 | +0815:00rs | +NaN | +0815:00rs | +
| 12 | +? | +NaN | +? | +
| 13 | +? | +NaN | +? | +
| 14 | +? | +NaN | +? | +
| 15 | +1100:00rs | +NaN | +1100:00rs | +
| 16 | +1815:00rs | +NaN | +1815:00rs | +
| 17 | +0830:00rs | +NaN | +0830:00rs | +
| 18 | +1145:00rs | +NaN | +1145:00rs | +
| 19 | +1820:00rs | +NaN | +1820:00rs | +
| + | Time | +Time_Clean | +
|---|---|---|
| 6117 | +NaN | +NaN | +
| 2843 | +09:30 | +NaN | +
| 3926 | +NaN | +NaN | +
| 2444 | +07:30 | +NaN | +
| 569 | +07:00 | +NaN | +
| 6882 | +NaN | +NaN | +
| 3933 | +NaN | +NaN | +
| 4680 | +NaN | +NaN | +
| 5612 | +NaN | +NaN | +
| 181 | +NaN | +NaN | +
| 2232 | +15:30 | +NaN | +
| 7066 | +NaN | +NaN | +
| 1171 | +17:51 | +NaN | +
| 4386 | +NaN | +NaN | +
| 5429 | +13:15 | +NaN | +
| 3797 | +NaN | +NaN | +
| 1411 | +NaN | +NaN | +
| 3443 | +15:30 | +NaN | +
| 3774 | +18:00 | +NaN | +
| 1616 | +NaN | +NaN | +
np.int64(7012)
Time +11:00 140 +15:00 128 +16:00 126 +12:00 122 +14:00 117 +16:30 88 +13:00 87 +17:30 83 +17:00 81 +14:30 76 +11:30 75 +18:00 75 +10:00 74 +15:30 73 +13:30 70 +10:30 61 +09:00 61 +08:00 43 +12:30 42 +09:30 39 +18:30 36 +07:30 35 +08:30 34 +07:00 28 +19:00 26 +13:20 20 +20:00 19 +11:45 19 +15:45 18 +11:15 18 +Name: count, dtype: int64
Number of observations: 7090 +Number of variables: 23 +
<class 'pandas.DataFrame'> +RangeIndex: 7090 entries, 0 to 7089 +Data columns (total 23 columns): + # Column Non-Null Count Dtype +--- ------ -------------- ----- + 0 Date 7090 non-null object + 1 Year 7088 non-null float64 + 2 Type 7072 non-null str + 3 Country 7040 non-null str + 4 State 6603 non-null str + 5 Location 6523 non-null str + 6 Activity 6507 non-null str + 7 Name 6872 non-null str + 8 Sex 6512 non-null str + 9 Age 4096 non-null object + 10 Injury 7054 non-null str + 11 Fatal Y/N 6529 non-null object + 12 Time 3563 non-null object + 13 Species 3959 non-null str + 14 Source 7070 non-null object + 15 pdf 6799 non-null object + 16 href formula 6794 non-null str + 17 href 6796 non-null str + 18 Case Number 6798 non-null str + 19 Case Number.1 6797 non-null str + 20 original order 6799 non-null float64 + 21 Unnamed: 21 1 non-null str + 22 Unnamed: 22 2 non-null str +dtypes: float64(2), object(6), str(15) +memory usage: 692.5+ KB +
| + | Date | +Year | +Type | +Country | +State | +Location | +Activity | +Name | +Sex | +Age | +... | +Species | +Source | +href formula | +href | +Case Number | +Case Number.1 | +original order | +Unnamed: 21 | +Unnamed: 22 | +|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | +False | +False | +False | +False | +False | +False | +False | +False | +False | +False | +... | +False | +False | +True | +True | +True | +True | +True | +True | +True | +True | +
| 1 | +False | +False | +False | +False | +False | +False | +False | +False | +False | +False | +... | +False | +False | +True | +True | +True | +True | +True | +True | +True | +True | +
| 2 | +False | +False | +False | +False | +False | +False | +False | +False | +False | +False | +... | +False | +False | +True | +True | +True | +True | +True | +True | +True | +True | +
| 3 | +False | +False | +False | +False | +False | +False | +False | +False | +False | +False | +... | +False | +False | +True | +True | +True | +True | +True | +True | +True | +True | +
| 4 | +False | +False | +False | +False | +False | +False | +False | +False | +False | +False | +... | +False | +False | +True | +True | +True | +True | +True | +True | +True | +True | +
5 rows × 23 columns
+Date 0 +Year 2 +Type 18 +Country 50 +State 487 +Location 567 +Activity 583 +Name 218 +Sex 578 +Age 2994 +Injury 36 +Fatal Y/N 561 +Time 3527 +Species 3131 +Source 20 +pdf 291 +href formula 296 +href 294 +Case Number 292 +Case Number.1 293 +original order 291 +Unnamed: 21 7089 +Unnamed: 22 7088 +dtype: int64
| + | State | +Location | +Time | +
|---|---|---|---|
| 0 | +Queensland | +Kennedy Shoal | +1100hrs | +
| 1 | +Maryland | +Assateague State Park | +? | +
| 2 | +Western Australia | +Horseshoe Reef Rottnest Island | +1000hrs | +
| 3 | +Gaafu Alif Atoll | +Kooddoo | +? | +
| 4 | +South Australia | +Middleton Beach Fleurieu Peninsula Adelaide | +? | +
pandas.DataFrame
State 487 +Location 567 +Time 3527 +dtype: int64
Most common state: Florida +
Nulls in State after fillna: 0 +Total rows : 7090 +
Most common location: New Smyrna Beach, Volusia County +
Nulls in Location after fillna: 0 +Total rows : 7090 +
Most common time: Afternoon +
Nulls in Time after fillna: 0 +Total rows : 7090 +
Date object +Year float64 +Type str +Country str +State str +Location str +Activity str +Name str +Sex str +Age object +Injury str +Fatal Y/N object +Time object +Species str +Source object +pdf object +href formula str +href str +Case Number str +Case Number.1 str +original order float64 +Unnamed: 21 str +Unnamed: 22 str +dtype: object
mambajs 0.21.1 + +Process pip requirements ... + +Successfully installed requests-2.34.2 charset_normalizer-3.4.7 idna-3.18 urllib3-2.7.0 certifi-2026.5.20 +
200
[{'name': 'iss', 'id': 25544}]{'cache-control': 'max-age=0, no-cache', 'content-length': '27', 'content-type': 'application/json'}
1.1. Web Communication Fundamentals¶
+
1.1.1. DNS, IP¶
+How do we connect to www.google.com?
+-
+
- DNS (Domain Name System): it's essentially the phonebook of the internet. Humans access information online through domain names, like "google.com". Web browsers, however, interact through Internet Protocol (IP) addresses. In this example, the DNS maps the internet address www.google.com to the server's IP: 216.58.222.196 +
- IP: Server identification. A code that allows information to be sent and received by the correct parties +
- Domain Providers: Sell and purchase Internet domains +
When making API calls to specific domains, the DNS translates the human-readable domain name into an IP address.
+1.1.2. HTTP¶
+Hyper Text Transfer Protocol
+-
+
- HTTP is a communications protocol that provides a structure for requests between the client and the server on a network. +
- For example, the web browser on the user's computer (the client) uses the HTTP protocol to request information from a website on a server. +
We will use APIs that employ the HTTP protocol as transport.
+1.1.3. URL¶
+Contains information about the resource being requested from the server.
+
Examples:
+-
+
- https://www.google.com/webhp?authuser=2 +
- https://www.towardsdatascience.com +
- https://www.ironhack.com/
-
+
- Protocol: https (https == http is the same, but https is encrypted) +
- Domain Name --> ironhack +
- TLD (Top-Level Domain) --> .com +
+
When calling an API, you specify the URL of the API endpoint, which tells the system where to send the request.
+1.2. HTTP Requests and Responses¶
+
Requests and responses are fundamental components of the client-server communication model.
+1.2.1. Requests¶
+These are queries or calls sent by the client (such as a web browser or other software) to the server in order to receive information (a response).
+A request typically consists of:
+-
+
- A method (such as GET, POST, PUT, DELETE) that defines the action to be performed
-
+
- GET: read the information of the resource, without modifying it in any way. Accessing the website from the browser gets information. +
+ - The URL or endpoint specifying the resource +
- Optional additional information such as:
-
+
- Headers (metadata): User-Agent, Accept-Language +
- Parameters +
- Body content. +
+
For example, a client might send a GET request to retrieve information from a web page or a POST request to submit form data.
+1.2.2. Response¶
+These are the answers or data sent by the server back to the client in reply to a request.
+A response typically includes:
+-
+
- A status code that indicates the success or failure of the request +
- Headers with meta-information about the server's behavior +
- The actual content or data (if applicable), such as HTML, JSON (similar to a Python dictionary), images, or other media types. +
An important part of the header is the status code. This code is a numerical value that indicates the server's result. There are different status codes depending on whether the server has managed to carry out the request or has not managed to do anything. These are some groups of status codes:
+-
+
- 2xx successful: the request was successfully received, understood, and accepted +
- 3xx redirection: more actions are required to complete the request +
- 4xx client error: the request contains incorrect syntax or cannot be fulfilled +
- 5xx server error: the server has failed to complete an apparently valid request +
Complete list: +https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
+Much more fun: +https://http.cat/
+1.3. APIs¶
+Application Programming Interface
+-
+
- APIs define a set of rules and protocols that allow different software applications to communicate with each other. +
- The client calls the server through an API, and the server responds. +
- Within a project, the backend may want to share information with the frontend without access to the database. +

1.3.1. RESTful APIs¶
+As a data analyst, you often need to access data from various sources. RESTful APIs provide a standardized way to retrieve, update, or delete data from other systems.
+-
+
Usually, we (the client) send a request, and they (the server) return a response, often in JSON - JavaScript Object Notation - format. While JSON looks similar to the dictionaries we're used to in Python, it's worth noting that when represented as raw text (e.g., in an API response), the entire JSON structure is a string. However, within that structure, JSON can represent various data types like numbers, booleans, and arrays, not just strings.
+
+APIs always need to provide documentation for their various services: endpoints. Each endpoint is a different URL.
+
+Sometimes we have to pass parameters to an API endpoint, similar to when we pass parameters to a Python function.
+
+
At this point in the Bootcamp, reading documentation becomes essential, as each API will "work" differently, and to use it, we will need to know what it requires.
+Here is a repository where you can find several free APIs if you feel like exploring a bit.
+1.4. Requests in Python¶
+You can make requests to RESTful APIs using libraries like requests.
1.4.1. GET¶
+Making a GET request to the API is simply a call to a URL that returns information when provided with the appropriate parameters. We will only perform GET requests.
Here is an example on how to make a request with Python:
+url = "https://api.example.com/products"
+response = requests.get(url)
+
+if response.status_code == 200:
+ products = response.json()
+ # Now you can analyze and work with the products data in Python1.4.1.1. Accessing an endpoint¶
+As we mentioned above, APIs always need to provide documentation for their various services: endpoints. Each endpoint is a different URL.
+Example: ISS API
+Let's get information from ISS (International Space Station)! We'll start looking at the ISS API documentation
+This API allows you to access various data related to the International Space Station (ISS), including its current, past, or future position, timezone information for specific coordinates, and more.
+Key Features
+-
+
- Authentication: No authentication is currently required, but future endpoints may include this. +
- Rate Limiting: Limited to approximately 1 request per second. +
- Responses: Default to JSON format, with optional parameters to modify response appearance. +
- Endpoints: Several endpoints provide different types of information:
-
+
- satellites: Information about satellites, including the ISS. +
- satellites/[id]: Position, velocity, and related information for a satellite. +
- satellites/[id]/positions: Position data for specific timestamps. +
- satellites/[id]/tles: TLE (Two-Line Element Set) data in either JSON or text format. +
- coordinates/[lat,lon]: Timezone information for specific coordinates. +
+
Examples
+-
+
- Satellite details:
https://api.wheretheiss.at/v1/satellites
+ - ISS position:
https://api.wheretheiss.at/v1/satellites/25544
+ - Coordinates information:
https://api.wheretheiss.at/v1/coordinates/37.795517,-122.393693
+
Endpoint satellites
+We can access the response content, which returns a string
+If response Content-Type is json, we can access it better with .json()
1.4.1.2. Response headers¶
+Response headers are part of the HTTP response that a server sends back to the client after a request has been made. These headers provide meta-information about the response and can affect how the client handles the response.
+Here are some common response headers and what they typically represent:
+-
+
+Date: Represents the date and time at which the response was sent.
+
+Server: Provides information about the software used by the originating server.
+
+X-Rate-Limit: Sometimes used in APIs to inform the client about rate limiting policies, such as the number of allowed requests in a given time frame.
+
+Content-Type: Specifies the media type of the resource or data the server is sending back. For example, it could beapplication/jsonfor a JSON object,text/htmlfor an HTML page, orimage/pngfor an image.
+
And more.
+1.4.1.3. Parameters¶
+As we mentioned above, sometimes we can pass parameters to an API endpoint, similar to when we pass parameters to a Python function.
+In the example above, we didn't use any parameters in the endpoint satellites since the documentation said Parameters: None.
API parameters are specific values that you include in a request to an API endpoint to filter, sort, or detail the data that you want to retrieve. They allow you to customize the request to get exactly the information you need.
+There are several types of parameters that can be used in API requests, such as Path Parameters, Query Parameters, Header Parameters and Request Body Parameters. Let's look at them with an example using another endpoint.
+1. Path Parameters¶
+These are embedded in the URL path and are used to identify a specific resource. For example, in the URL above https://api.wheretheiss.at/v1/satellites/25544, the number 25544 is a path parameter that identifies a specific sattelite.
Endpoint satellites/id
+Lets use endpoint satellites/[id] with the id we got from the previous endpoint.
+Important, we need to provide the whole url for the endpoint as a string.
Every time we call the endpoint, the information changes since it gives us the current position of the satellite. Let's check that with a loop to gather information at different times.
+Let's extract 10 latitudes from the 10 dictionaries in the list, with 2 decimals.
+2. Query Parameters¶
+These are added to the end of the URL after a question mark (?) and are often used to filter or sort the response.
For example, in the ISS documentation, it mentions that there is a parameter units that can take values miles or kilometers. So in the URL https://api.wheretheiss.at/v1/satellites/25544?units=miles, we added units=miles which is a query parameter that shows the data in "miles".
In general, we add the parameters like this ?param1=value1¶m2=value2... at the end of the URL.
We can also do it by passing to the argument params a dictionary with the parameters in the get method.
3. Header Parameters¶
+These are included in the request header and can be used for various purposes, such as authentication (e.g., sending an API key or token), content negotiation (e.g., defining the response format), or custom settings defined by the API. If the API requires authentication, you might include an Authorization header with your API key.
ISS API mentions that currently there is no authentication required. So we'll look at an example with a different API of authentication in header parameters.
1.4.1.4. Request Headers¶
+Request headers are key-value pairs sent in an HTTP request to provide information about the request itself.
+Some request headers are:
+-
+
Content-Type: Specifies the media type of the resource or data. Common examples include "application/json" for JSON data, "text/html" for HTML content, and "application/xml" for XML data.
+
+Authorization: Contains credentials for authenticating the client with the server, often used with tokens or other forms of authentication.
+
+User-Agent: Provides information about the client (browser or other client), including its version and operating system.
+
+
In Python's requests library, you can include headers in a request by using the headers argument, like this:
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_TOKEN'}
+response = requests.get(url, headers=headers)⚠️🚨 ¡Careful with the authentication token! ⚠️🚨 A token is a personal credential for accessing an API, through which your request quota to the API is managed. Therefore, the ideal procedure is to ensure security by storing the token as a variable in an .env file. This way, you can call the environment variable without having to publicly display the token.
+Example: News API
+The News API lets you locate articles and breaking news headlines from news sources and blogs across the web.
+-
+
- Let's look at the NewsAPI Authentication documentation. It mentions: +
You can attach your API key to a request in one of three ways:
+
+- Via the apiKey querystring parameter.
+- Via the X-Api-Key HTTP header.
+- Via the Authorization HTTP header. Including Bearer is optional, and be sure not to base 64 encode it like you may have seen in other authentication tutorials.
+We strongly recommend the either of last two so that your API key isn't visible to others in logs or via request sniffing.
+
+If you don't append your API key correctly, or your API key is invalid, you will receive a 401 - Unauthorized HTTP error.
+
+-
+
- Let's look at the documentation for the endpoints to see what parameters they accept: NewsAPI endpoints. We see we have the endpoint
/v2/top-headlines– returns breaking news headlines for countries, categories, and singular publishers. This is perfect for use with news tickers or anywhere you want to use live up-to-date news headlines. +If we look at the documentation of that endpoint we see we have more parameters we can add such ascountryorcategory.
+
Let's try a made up key, using the apiKey querystring parameter. As we read in the documentation, this is not the recommended way.
+4xx: client error. This means, it is our error.
+Lets do with a correct key. You should get your own API key through their website. Once we've saved our key, we'll send it via the X-Api-Key HTTP header.
+Saving the API Key¶
+Storing an API key directly in your code can expose sensitive information, especially if your code is publicly available (e.g., on a public GitHub repository). The best practice for saving and loading an API key in your code involves the following steps:
+-
+
Storing the API Key:
+-
+
Use Environment Variables: Store your API key in an environment variable on your system. This keeps the key out of your codebase and allows you to change it without altering your code.
+
+Create a .env File: If you prefer, you can create a
+.envfile (just call it.envnothing else before the.) in your project directory to store the API key. Inside this file, you would have something like:
+API_KEY=your-api-key-here +-
+
- Add .env to .gitignore: If you're using a version control system like Git, make sure to add the
.envfile to your.gitignorefile. This prevents the.envfile (and therefore your API key) from being uploaded to any public repositories. We'll talk about Git and .gitignore in more detail soon.
+
+- Add .env to .gitignore: If you're using a version control system like Git, make sure to add the
+Load the Key in Your Code:
+You can use libraries like
+python-dotenvto load the key into your code. + You would need to installpython-dotenvfirst.!pip install python-dotenv + +from dotenv import load_dotenv +import os + +load_dotenv() +api_key = os.getenv("API_KEY")Now,
+api_keycontains the value of your API key, and you can use it to authenticate your requests to the API.
+
Lets do the second approach. Lets save it in an env file and save it in a variable.
+Make sure your file is named .env and not .env.txt! Is one of the most common errors. If you need, look at the document properties to make sure it doesn't have .txt at the end even if its not showing the .txt when looking at your folder.
If you get an error, make sure you saved the .env file in the same directory as your jupyter notebook. You can use os.getcwd() to do so.
Using the API Key in the Header Parameters¶
+APIs examples¶
+1.5.1. NewsAPI¶
+dict[key] raises error if the key does not exitsdict.get(key) does not raise an error if the key does not exist
1.5.1.1. 💡 Check for understanding¶
+-
+
- What data type is the column source? +
- Since the column source is not very useful as it is, create a column called name that contains only the name inside the column source. +
- How many times each unique name appears in the "name" column? +
1.5.2. Pokemon API¶
+PokeAPI is a full RESTful API linked to an extensive database detailing everything about the Pokémon main game series.
+In the documentation we see that we can get lot's of data. Let's look at the endpoint pokemon: https://pokeapi.co/api/v2/pokemon/{id or name}/
We will define a function, get_pokemon, that takes an ID number as input. This function fetches details about a Pokémon from the PokeAPI using the given ID, extracts its name, weight, and front-facing image, and then returns this data in a dictionary format. If the ID is invalid or there's an issue with the request, a ValueError is raised.
We will now define a function, print_pokemon, that takes in a Pokémon dictionary and displays its ID, name, weight, and its image.
After defining this function, we will retrieve and display details for the first 10 Pokémon by iterating through their IDs and using both the get_pokemon and print_pokemon functions.
1.5.2.1. json_normalize()¶
+Want the data as a DataFrame instead of a dictionary?
+The following line creates a DataFrame from the items of the dictionary data. Each key-value pair will be treated as a row, with two columns: the first for the key and the second for the value.
+That format is still very hard to work with. Lets use json_normalize instead. json_normalize is used to normalize semi-structured JSON data into a flat table (DataFrame). It's particularly useful when dealing with nested dictionaries or lists inside JSON.
A lot better, even though we still have nested dictionaries or lists inside the dataframe.
+Let's see again the difference between creating a dataframe directly or using json_normalize by using data["abilities"].
1.5.3. Coincap API¶
+CoinCap is a useful tool for real-time pricing and market activity for over 1,000 cryptocurrencies. Check the documentation at https://docs.coincap.io/
+1.5.4. Api Jokes¶
+JokeAPI is a REST API that serves uniformly and well formatted jokes. +It can be used without any API token, membership, registration or payment. +It supports a variety of filters that can be applied to get just the right jokes you need. +Check the documentation here: https://jokeapi.dev/
+1.5.5. 💡 Check for understanding¶
+Choose one API from the Public APIs list. Attempt to call your selected API, either with or without parameters, and retrieve some valuable information. Document your findings.
+API Wrappers¶
+A Python wrapper is a Python library or module that provides a more convenient or more "Pythonic" interface to another software component, such as a library in another language, a system tool, or a web API. It "wraps" the functionality of that component in a way that abstracts away its complexities and makes it easier to use in a Python context. 🙌🏻
+One example is the tweepy library, which makes obtaining data from Twitter's API relatively straightforward.
Summary¶
+-
+
- Import the
requestslibrary.
+ - Store the necessary credentials, such as API key or OAuth tokens, if the API requires them. +
- Execute a
request.getto the desired API endpoint (the API's documentation will provide details on available endpoints).
+ - The API returns a JSON response. +
- This JSON can be converted into a dataframe, or you can further explore its elements (typically a list of dictionaries). +
1.8. Glossary¶
+-
+
- DNS: domain name system. +
- HTTP: is the protocol used to transfer data over the web. +
- API: application programming interface. +
- REST: series of rules, architectural style. +
-
+
requests: Python library for interacting with APIs.
+- URL: server name you want to ask information for. +
- endpoint: server service you want to ask information for. +
- parameters: extra parameters to your query. +
- headers: metadata, invisible information. +
1.9. Further materials¶
+RapidAPI: access thousands of APIs.
+mambajs 0.21.1 + +Process pip requirements ... + +Requirement requests already satisfied. +
Result: 10.0 +Division operation completed. +Error: Cannot divide by zero. +Division operation completed. +Error: Both inputs must be numbers. +Division operation completed. +
Element found: 2 +List access completed. +Error: Index out of range. +List access completed. +
Value: Alice +Dictionary lookup completed. +Error: Key not found. +Dictionary lookup completed. +
Age entered: 5 +Age validation completed. +Age entered: 18 +Age validation completed. +
Are you sure? (yes/no): yes +
Age entered: 1001 +Age validation completed. +Error: Age cannot be negative. +Age validation completed. +
['Open', 'Open', 'Senior', 'Open', 'Open', 'Senior'] +
23 +
[6, 5, 4, 3, 2, 1] +
[-1, -2, -3, -4, -5] +[-1, 2, -3, 4, -5] +[] +
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81, 10: 100, 11: 121, 12: 144, 13: 169, 14: 196, 15: 225}
+[(5, 3), (5, 4), (6, 3), (6, 4)] +
[('a', 1), ('a', 2), ('b', 3), ('b', 4)]
+[(10, 30), (10, 40), (20, 30), (20, 40), (50, 70), (50, 80), (60, 70), (60, 80)] +
{('w', 'y'), ('x', 'z'), ('x', 'y'), ('w', 'z')}
+- lab-python-data-structures.ipynb
- Untitled16.ipynb
- Untitled17.ipynb
- Untitled20.ipynb
- Untitled21.ipynb
- Project_shark_DF team.ipynb
- Untitled30.ipynb
- Untitled34.ipynb
- Untitled35.ipynb
- Challenge Katas.ipynb
- lab_error_handling_exercices.ipynb
- Untitled38.ipynb
- 2.5_apis.ipynb
- .env.txt
- Untitled41.ipynb