{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Python Advanced (2023-01-15 - 2024-01-17)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "a = 42\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "int" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(a)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Die Function ``dir()`` wird verwendet, um die attribute von a anzuzeigen" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['__abs__',\n", " '__add__',\n", " '__and__',\n", " '__bool__',\n", " '__ceil__',\n", " '__class__',\n", " '__delattr__',\n", " '__dir__',\n", " '__divmod__',\n", " '__doc__',\n", " '__eq__',\n", " '__float__',\n", " '__floor__',\n", " '__floordiv__',\n", " '__format__',\n", " '__ge__',\n", " '__getattribute__',\n", " '__getnewargs__',\n", " '__getstate__',\n", " '__gt__',\n", " '__hash__',\n", " '__index__',\n", " '__init__',\n", " '__init_subclass__',\n", " '__int__',\n", " '__invert__',\n", " '__le__',\n", " '__lshift__',\n", " '__lt__',\n", " '__mod__',\n", " '__mul__',\n", " '__ne__',\n", " '__neg__',\n", " '__new__',\n", " '__or__',\n", " '__pos__',\n", " '__pow__',\n", " '__radd__',\n", " '__rand__',\n", " '__rdivmod__',\n", " '__reduce__',\n", " '__reduce_ex__',\n", " '__repr__',\n", " '__rfloordiv__',\n", " '__rlshift__',\n", " '__rmod__',\n", " '__rmul__',\n", " '__ror__',\n", " '__round__',\n", " '__rpow__',\n", " '__rrshift__',\n", " '__rshift__',\n", " '__rsub__',\n", " '__rtruediv__',\n", " '__rxor__',\n", " '__setattr__',\n", " '__sizeof__',\n", " '__str__',\n", " '__sub__',\n", " '__subclasshook__',\n", " '__truediv__',\n", " '__trunc__',\n", " '__xor__',\n", " 'as_integer_ratio',\n", " 'bit_count',\n", " 'bit_length',\n", " 'conjugate',\n", " 'denominator',\n", " 'from_bytes',\n", " 'imag',\n", " 'is_integer',\n", " 'numerator',\n", " 'real',\n", " 'to_bytes']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dir(a)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Syntax" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "yay\n" ] } ], "source": [ "a = 42\n", "if a == 42:\n", " print('yay')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "yay\n" ] } ], "source": [ "if a == 42:\n", " print('yay')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## DocStrings" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# the function foo foos's a bar\n", "# and returns the square of it\n", "def foo(bar):\n", " return bar**2" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def foo(bar):\n", " \"\"\"the function foo foos's a bar\n", " and returns the square of it\"\"\"\n", " return bar**2" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "function" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(foo)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"the function foo foos's a bar\\n and returns the square of it\"" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "foo.__doc__" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function foo in module __main__:\n", "\n", "foo(bar)\n", " the function foo foos's a bar\n", " and returns the square of it\n", "\n" ] } ], "source": [ "help(foo)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Type System" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "int" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a = 42\n", "type(a)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "b = 43" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "85" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a + b" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "c = 'abc'" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "def maximum(l, r):\n", " if l < r:\n", " return r\n", " return l" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "maximum(1,2)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " '<' not supported between instances of 'int' and 'str'\n" ] } ], "source": [ "try:\n", " maximum(1, '2')\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "maximum(1.2, 2)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "def maximum_number(l, r):\n", " if l < r:\n", " return r\n", " return l" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " '<' not supported between instances of 'int' and 'str'\n" ] } ], "source": [ "try:\n", " maximum_number(1, '2')\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " '<' not supported between instances of 'int' and 'list'\n" ] } ], "source": [ "try:\n", " maximum_number(1, [1, 2, 3])\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Variables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Tuple Unpacking" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "a = 42" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "a, b = 42, 666" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "666" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "(a, b) = (42, 666)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "def foo():\n", " return 42, 666" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "rv = foo()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(42, 666)" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rv" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "a, b = foo()" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(42, 666)" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a, b" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "tmp = a\n", "a = b\n", "b = tmp" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(666, 42)" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a, b" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [], "source": [ "a, b = b, a" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(42, 666)" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a, b" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Assignment Details" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [], "source": [ "a = 42" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a)" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "b = a" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(b)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [], "source": [ "b += 1" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "43" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "xxx = 666" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "666" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xxx" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [], "source": [ "del xxx" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " name 'xxx' is not defined\n" ] } ], "source": [ "try:\n", " xxx\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "d = {\n", " 'a': 1,\n", " 'b': 2,\n", "}" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'a': 1, 'b': 2}" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "globals()['a']" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [], "source": [ "a = 1234" ] }, { "cell_type": "code", "execution_count": 51, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1234" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "globals()['a']" ] }, { "cell_type": "code", "execution_count": 52, "metadata": {}, "outputs": [], "source": [ "del a" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Infinity?" ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [], "source": [ "a = 2**64-1" ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "18446744073709551615" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0b1111111111111111111111111111111111111111111111111111111111111111'" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bin(a)" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "66" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(bin(a))" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [], "source": [ "a += 1" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0b10000000000000000000000000000000000000000000000000000000000000000'" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bin(a)" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "67" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(bin(a))" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "10**1000" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Datatype Conversions" ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [], "source": [ "a = '42'" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "str" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(a)" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "int(a)" ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " invalid literal for int() with base 10: '42.0'\n" ] } ], "source": [ "try:\n", " int('42.0')\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'42'" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "str(42)" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "66" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "int('0x42', 16)" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42.0" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "float(42)" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42.666" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "float('42.666')" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "int(42.666)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Compound Datatypes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Lists" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [], "source": [ "l = list()" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "list" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(l)" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [], "source": [ "l = []" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [], "source": [ "l = [1,2,'drei']" ] }, { "cell_type": "code", "execution_count": 74, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "drei\n" ] } ], "source": [ "for elem in l:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 75, "metadata": {}, "outputs": [], "source": [ "l.append(4.0)" ] }, { "cell_type": "code", "execution_count": 76, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 'drei', 4.0]" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 77, "metadata": {}, "outputs": [], "source": [ "l1 = [5, 6, 7]" ] }, { "cell_type": "code", "execution_count": 78, "metadata": {}, "outputs": [], "source": [ "l.extend(l1)" ] }, { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 'drei', 4.0, 5, 6, 7]" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [], "source": [ "l2 = [8, 9, 10]" ] }, { "cell_type": "code", "execution_count": 81, "metadata": {}, "outputs": [], "source": [ "l.append(l2)" ] }, { "cell_type": "code", "execution_count": 82, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 'drei', 4.0, 5, 6, 7, [8, 9, 10]]" ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'drei'" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l[2]" ] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " list index out of range\n" ] } ], "source": [ "try:\n", " l[100]\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " list assignment index out of range\n" ] } ], "source": [ "try:\n", " l[100] = 666\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [], "source": [ "l += l2" ] }, { "cell_type": "code", "execution_count": 87, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 'drei', 4.0, 5, 6, 7, [8, 9, 10], 8, 9, 10]" ] }, "execution_count": 87, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 88, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 88, "metadata": {}, "output_type": "execute_result" } ], "source": [ "6 in l" ] }, { "cell_type": "code", "execution_count": 89, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "10 in l" ] }, { "cell_type": "code", "execution_count": 90, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 90, "metadata": {}, "output_type": "execute_result" } ], "source": [ "666 in l" ] }, { "cell_type": "code", "execution_count": 91, "metadata": {}, "outputs": [], "source": [ "del l[2]" ] }, { "cell_type": "code", "execution_count": 92, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 4.0, 5, 6, 7, [8, 9, 10], 8, 9, 10]" ] }, "execution_count": 92, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 93, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l.pop()" ] }, { "cell_type": "code", "execution_count": 94, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 4.0, 5, 6, 7, [8, 9, 10], 8, 9]" ] }, "execution_count": 94, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Tuple" ] }, { "cell_type": "code", "execution_count": 95, "metadata": {}, "outputs": [], "source": [ "t = (1, 2, 'drei')" ] }, { "cell_type": "code", "execution_count": 96, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'drei'" ] }, "execution_count": 96, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t[2]" ] }, { "cell_type": "code", "execution_count": 97, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 'tuple' object has no attribute 'append'\n" ] } ], "source": [ "try:\n", " t.append(4.0)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 98, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ "2 in t" ] }, { "cell_type": "code", "execution_count": 99, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" } ], "source": [ "666 in t" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Dictionary" ] }, { "cell_type": "code", "execution_count": 100, "metadata": {}, "outputs": [], "source": [ "d = {\n", " 'one': 1,\n", " 'two': 2,\n", "}" ] }, { "cell_type": "code", "execution_count": 101, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict" ] }, "execution_count": 101, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(d)" ] }, { "cell_type": "code", "execution_count": 102, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 102, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d['one']" ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 103, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'one' in d" ] }, { "cell_type": "code", "execution_count": 104, "metadata": {}, "outputs": [], "source": [ "d['one'] = 1.0" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 'three'\n" ] } ], "source": [ "try:\n", " d['three']\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [], "source": [ "del d['one']" ] }, { "cell_type": "code", "execution_count": 107, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'two': 2}" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 108, "metadata": {}, "outputs": [], "source": [ "d = {'one': 1, 'two': 2, 'three': 3}" ] }, { "cell_type": "code", "execution_count": 109, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one\n", "two\n", "three\n" ] } ], "source": [ "for elem in d:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 110, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one\n", "two\n", "three\n" ] } ], "source": [ "for elem in d.keys():\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 111, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n" ] } ], "source": [ "for elem in d.values():\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 112, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "('one', 1)\n", "('two', 2)\n", "('three', 3)\n" ] } ], "source": [ "for elem in d.items():\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 113, "metadata": {}, "outputs": [], "source": [ "a, b = 1, 2" ] }, { "cell_type": "code", "execution_count": 114, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one 1\n", "two 2\n", "three 3\n" ] } ], "source": [ "for elem in d.items():\n", " # potschert\n", " k = elem[0]\n", " v = elem[1]\n", " print(k, v)" ] }, { "cell_type": "code", "execution_count": 115, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one 1\n", "two 2\n", "three 3\n" ] } ], "source": [ "# Pythonic\n", "for k, v in d.items():\n", " print(k, v)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Sets" ] }, { "cell_type": "code", "execution_count": 116, "metadata": {}, "outputs": [], "source": [ "s = set()" ] }, { "cell_type": "code", "execution_count": 117, "metadata": {}, "outputs": [], "source": [ "s= {} # dict!" ] }, { "cell_type": "code", "execution_count": 118, "metadata": {}, "outputs": [], "source": [ "s = {1, 2, 'drei'}" ] }, { "cell_type": "code", "execution_count": 119, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "drei\n" ] } ], "source": [ "for elem in s:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 120, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 120, "metadata": {}, "output_type": "execute_result" } ], "source": [ "2 in s" ] }, { "cell_type": "code", "execution_count": 121, "metadata": {}, "outputs": [], "source": [ "s.add(4.0)" ] }, { "cell_type": "code", "execution_count": 122, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 122, "metadata": {}, "output_type": "execute_result" } ], "source": [ "4.0 in s" ] }, { "cell_type": "code", "execution_count": 123, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 'set' object is not subscriptable\n" ] } ], "source": [ "try:\n", " s[3]\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 124, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{1, 2, 4.0, 'drei'}" ] }, "execution_count": 124, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s" ] }, { "cell_type": "code", "execution_count": 125, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{1, 2, 'drei', 4.0}\n" ] } ], "source": [ "print(s)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### ``enumerate()``" ] }, { "cell_type": "code", "execution_count": 126, "metadata": {}, "outputs": [], "source": [ "l = [1, 2, 3, 4]" ] }, { "cell_type": "code", "execution_count": 127, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n", "4\n" ] } ], "source": [ "for elem in l:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 128, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 1\n", "1 2\n", "2 3\n", "3 4\n" ] } ], "source": [ "idx = 0\n", "for elem in l:\n", " print(idx, elem)\n", " idx += 1" ] }, { "cell_type": "code", "execution_count": 129, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(0, 1)\n", "(1, 2)\n", "(2, 3)\n", "(3, 4)\n" ] } ], "source": [ "for elem in enumerate(l):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 130, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 1\n", "1 2\n", "2 3\n", "3 4\n" ] } ], "source": [ "for elem in enumerate(l):\n", " idx = elem[0]\n", " value = elem[1]\n", " print(idx, value)" ] }, { "cell_type": "code", "execution_count": 131, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 1\n", "1 2\n", "2 3\n", "3 4\n" ] } ], "source": [ "for idx, value in enumerate(l):\n", " print(idx, value)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### ``dict``, and ``enumerate()``" ] }, { "cell_type": "code", "execution_count": 132, "metadata": {}, "outputs": [], "source": [ "pairs = [('one', 1), ('two', 2)]" ] }, { "cell_type": "code", "execution_count": 133, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1, 'two': 2}" ] }, "execution_count": 133, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d = dict(pairs)\n", "d" ] }, { "cell_type": "code", "execution_count": 134, "metadata": {}, "outputs": [], "source": [ "l = ['zero', 'one']" ] }, { "cell_type": "code", "execution_count": 135, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "zero\n", "one\n" ] } ], "source": [ "for elem in l:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 136, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 zero\n", "1 one\n" ] } ], "source": [ "idx = 0\n", "for elem in l:\n", " print(idx, elem)\n", " idx += 1" ] }, { "cell_type": "code", "execution_count": 137, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(0, 'zero')\n", "(1, 'one')\n" ] } ], "source": [ "for elem in enumerate(l):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 138, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 zero\n", "1 one\n" ] } ], "source": [ "for idx, value in enumerate(l):\n", " print(idx, value)" ] }, { "cell_type": "code", "execution_count": 139, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0: 'zero', 1: 'one'}" ] }, "execution_count": 139, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dict(enumerate(l))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ``while``" ] }, { "cell_type": "code", "execution_count": 140, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "5050\n" ] } ], "source": [ "summe = 0\n", "num = 1\n", "while num <= 100:\n", " summe += num\n", " num += 1\n", "print(summe)" ] }, { "cell_type": "code", "execution_count": 141, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5050" ] }, "execution_count": 141, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum(range(1, 101)) # so gehts auch" ] }, { "cell_type": "code", "execution_count": 142, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "hooray nach dem 2 ten versuch\n" ] } ], "source": [ "import random\n", "n_tries = 0\n", "while True:\n", " n_tries += 1\n", " eyes = random.randrange(1, 7)\n", " if eyes == 6:\n", " print('hooray nach dem', n_tries, 'ten versuch')\n", " break" ] }, { "cell_type": "code", "execution_count": 143, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "win\n" ] } ], "source": [ "n_tries = 0\n", "win = False\n", "while n_tries < 10:\n", " n_tries += 1\n", " eyes = random.randrange(1, 7)\n", " if eyes == 6:\n", " win = True\n", " break\n", "if win:\n", " print('win')\n", "else:\n", " print('lose')" ] }, { "cell_type": "code", "execution_count": 144, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "win\n" ] } ], "source": [ "n_tries = 0\n", "while n_tries < 10:\n", " n_tries += 1\n", " eyes = random.randrange(1, 7)\n", " if eyes == 6:\n", " print('win')\n", " break\n", "else:\n", " print('lose')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## ``range()``" ] }, { "cell_type": "code", "execution_count": 145, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "2\n" ] } ], "source": [ "for elem in range(3):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 146, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "3\n" ] } ], "source": [ "for elem in range(1, 4):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 147, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "3\n", "5\n", "7\n" ] } ], "source": [ "for elem in range(1, 9, 2):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 148, "metadata": {}, "outputs": [], "source": [ "l = [0,1,2]" ] }, { "cell_type": "code", "execution_count": 149, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "2\n" ] } ], "source": [ "for elem in l:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 150, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "2\n" ] } ], "source": [ "for elem in range(3):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 151, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "range" ] }, "execution_count": 151, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r = range(3)\n", "type(r)" ] }, { "cell_type": "code", "execution_count": 152, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "range(0, 3)\n" ] } ], "source": [ "print(r)" ] }, { "cell_type": "code", "execution_count": 153, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "print(type(r))" ] }, { "cell_type": "code", "execution_count": 154, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "2\n" ] } ], "source": [ "for elem in r:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 155, "metadata": {}, "outputs": [], "source": [ "r = range(3)" ] }, { "cell_type": "code", "execution_count": 156, "metadata": {}, "outputs": [], "source": [ "it = iter(r)" ] }, { "cell_type": "code", "execution_count": 157, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 157, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 158, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 158, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 159, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 159, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 160, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " \n" ] } ], "source": [ "try:\n", " next(it)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 161, "metadata": {}, "outputs": [], "source": [ "l = [0,1,2]" ] }, { "cell_type": "code", "execution_count": 162, "metadata": {}, "outputs": [], "source": [ "it = iter(l)" ] }, { "cell_type": "code", "execution_count": 163, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 163, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 164, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 164, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 165, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 165, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 166, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " \n" ] } ], "source": [ "try:\n", " next(it)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 167, "metadata": {}, "outputs": [], "source": [ "def even(maximum):\n", " rv = []\n", " num = 0\n", " while num < maximum:\n", " if num%2 == 0:\n", " rv.append(num)\n", " num += 1\n", " return rv" ] }, { "cell_type": "code", "execution_count": 168, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "2\n", "4\n", "6\n", "8\n" ] } ], "source": [ "for elem in even(10):\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 169, "metadata": {}, "outputs": [], "source": [ "def even(maximum):\n", " print('start')\n", " num = 0\n", " while num < maximum:\n", " if num%2 == 0:\n", " print('suspend, produce', num)\n", " yield num\n", " print('wakeup')\n", " num += 1\n", " print('end')" ] }, { "cell_type": "code", "execution_count": 170, "metadata": {}, "outputs": [], "source": [ "nums = even(10)" ] }, { "cell_type": "code", "execution_count": 171, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "print(nums)" ] }, { "cell_type": "code", "execution_count": 172, "metadata": {}, "outputs": [], "source": [ "it = iter(nums)" ] }, { "cell_type": "code", "execution_count": 173, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "start\n", "suspend, produce 0\n" ] }, { "data": { "text/plain": [ "0" ] }, "execution_count": 173, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 174, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wakeup\n", "suspend, produce 2\n" ] }, { "data": { "text/plain": [ "2" ] }, "execution_count": 174, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 175, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wakeup\n", "suspend, produce 4\n" ] }, { "data": { "text/plain": [ "4" ] }, "execution_count": 175, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 176, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wakeup\n", "suspend, produce 6\n" ] }, { "data": { "text/plain": [ "6" ] }, "execution_count": 176, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 177, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wakeup\n", "suspend, produce 8\n" ] }, { "data": { "text/plain": [ "8" ] }, "execution_count": 177, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(it)" ] }, { "cell_type": "code", "execution_count": 178, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wakeup\n", "end\n", " \n" ] } ], "source": [ "try:\n", " next(it)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 179, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2\n", "3\n", "4\n", "5\n", "6\n", "7\n", "8\n", "9\n" ] } ], "source": [ "cnt = 2\n", "while cnt < 10:\n", " print(cnt)\n", " cnt += 1" ] }, { "cell_type": "code", "execution_count": 180, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2\n", "3\n", "4\n", "5\n", "6\n", "7\n", "8\n", "9\n" ] } ], "source": [ "for cnt in range(2, 10, 1):\n", " print(cnt)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Functions" ] }, { "cell_type": "code", "execution_count": 181, "metadata": {}, "outputs": [], "source": [ "def maximum(a: int, b: int) -> int:\n", " if a < b:\n", " return b\n", " return a" ] }, { "cell_type": "code", "execution_count": 182, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'b'" ] }, "execution_count": 182, "metadata": {}, "output_type": "execute_result" } ], "source": [ "maximum('a', 'b')" ] }, { "cell_type": "code", "execution_count": 183, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 183, "metadata": {}, "output_type": "execute_result" } ], "source": [ "maximum(1, 2)" ] }, { "cell_type": "code", "execution_count": 184, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.2" ] }, "execution_count": 184, "metadata": {}, "output_type": "execute_result" } ], "source": [ "maximum(1, 1.2)" ] }, { "cell_type": "code", "execution_count": 185, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " '<' not supported between instances of 'int' and 'str'\n" ] } ], "source": [ "try:\n", " maximum(1, '2')\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 186, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 186, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1.0 == 1" ] }, { "cell_type": "code", "execution_count": 187, "metadata": {}, "outputs": [], "source": [ "f = 1.0" ] }, { "cell_type": "code", "execution_count": 188, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 188, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.__eq__(1)" ] }, { "cell_type": "code", "execution_count": 189, "metadata": {}, "outputs": [], "source": [ "s = '1'" ] }, { "cell_type": "code", "execution_count": 190, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NotImplemented" ] }, "execution_count": 190, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.__eq__(1)" ] }, { "cell_type": "code", "execution_count": 191, "metadata": {}, "outputs": [], "source": [ "i = 1" ] }, { "cell_type": "code", "execution_count": 192, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NotImplemented" ] }, "execution_count": 192, "metadata": {}, "output_type": "execute_result" } ], "source": [ "i.__eq__('1')" ] }, { "cell_type": "code", "execution_count": 193, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140525696085312" ] }, "execution_count": 193, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(maximum)" ] }, { "cell_type": "code", "execution_count": 194, "metadata": {}, "outputs": [], "source": [ "a = maximum" ] }, { "cell_type": "code", "execution_count": 195, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 195, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a(1, 2)" ] }, { "cell_type": "code", "execution_count": 196, "metadata": {}, "outputs": [], "source": [ "def create_print_function(msg):\n", " def inner():\n", " print(msg)\n", " return inner" ] }, { "cell_type": "code", "execution_count": 197, "metadata": {}, "outputs": [], "source": [ "joerg = create_print_function('Joerg')" ] }, { "cell_type": "code", "execution_count": 198, "metadata": {}, "outputs": [ { "data": { "text/plain": [ ".inner()>" ] }, "execution_count": 198, "metadata": {}, "output_type": "execute_result" } ], "source": [ "joerg" ] }, { "cell_type": "code", "execution_count": 199, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Joerg\n" ] } ], "source": [ "joerg()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## References, (Im)mutability" ] }, { "cell_type": "code", "execution_count": 200, "metadata": {}, "outputs": [], "source": [ "a = 42\n", "b = a" ] }, { "cell_type": "code", "execution_count": 201, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 201, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a)" ] }, { "cell_type": "code", "execution_count": 202, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 202, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(b)" ] }, { "cell_type": "code", "execution_count": 203, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 203, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a) == id(b)" ] }, { "cell_type": "code", "execution_count": 204, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 204, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a is b" ] }, { "cell_type": "code", "execution_count": 205, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 205, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a == b" ] }, { "cell_type": "code", "execution_count": 206, "metadata": {}, "outputs": [], "source": [ "a += 1" ] }, { "cell_type": "code", "execution_count": 207, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219464" ] }, "execution_count": 207, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a)" ] }, { "cell_type": "code", "execution_count": 208, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 208, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a is b" ] }, { "cell_type": "code", "execution_count": 209, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 209, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a == b" ] }, { "cell_type": "code", "execution_count": 210, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'abc'" ] }, "execution_count": 210, "metadata": {}, "output_type": "execute_result" } ], "source": [ "c" ] }, { "cell_type": "code", "execution_count": 211, "metadata": {}, "outputs": [], "source": [ "del c" ] }, { "cell_type": "code", "execution_count": 212, "metadata": {}, "outputs": [], "source": [ "c = 666" ] }, { "cell_type": "code", "execution_count": 213, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140525697462832" ] }, "execution_count": 213, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(c)" ] }, { "cell_type": "code", "execution_count": 214, "metadata": {}, "outputs": [], "source": [ "c += 1" ] }, { "cell_type": "code", "execution_count": 215, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140525697462736" ] }, "execution_count": 215, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(c)" ] }, { "cell_type": "code", "execution_count": 216, "metadata": {}, "outputs": [], "source": [ "a = 42" ] }, { "cell_type": "code", "execution_count": 217, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 217, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a)" ] }, { "cell_type": "code", "execution_count": 218, "metadata": {}, "outputs": [], "source": [ "b = 42" ] }, { "cell_type": "code", "execution_count": 219, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140526007219432" ] }, "execution_count": 219, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(b)" ] }, { "cell_type": "code", "execution_count": 220, "metadata": {}, "outputs": [], "source": [ "a = 666" ] }, { "cell_type": "code", "execution_count": 221, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140525697463408" ] }, "execution_count": 221, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(a)" ] }, { "cell_type": "code", "execution_count": 222, "metadata": {}, "outputs": [], "source": [ "b = 666" ] }, { "cell_type": "code", "execution_count": 223, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "140525697463280" ] }, "execution_count": 223, "metadata": {}, "output_type": "execute_result" } ], "source": [ "id(b)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Shallow copy" ] }, { "cell_type": "code", "execution_count": 224, "metadata": {}, "outputs": [], "source": [ "a = [1,2,3]\n", "b = a[:]" ] }, { "cell_type": "code", "execution_count": 225, "metadata": {}, "outputs": [], "source": [ "b.append(4)" ] }, { "cell_type": "code", "execution_count": 226, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 3, 4]" ] }, "execution_count": 226, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b" ] }, { "cell_type": "code", "execution_count": 227, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, 3]" ] }, "execution_count": 227, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "code", "execution_count": 228, "metadata": {}, "outputs": [], "source": [ "a = [1,2,[3,4,5],6, 7]\n", "b = a[:]" ] }, { "cell_type": "code", "execution_count": 229, "metadata": {}, "outputs": [], "source": [ "b[2].append(666)" ] }, { "cell_type": "code", "execution_count": 230, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, [3, 4, 5, 666], 6, 7]" ] }, "execution_count": 230, "metadata": {}, "output_type": "execute_result" } ], "source": [ "b" ] }, { "cell_type": "code", "execution_count": 231, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1, 2, [3, 4, 5, 666], 6, 7]" ] }, "execution_count": 231, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More About Strings" ] }, { "cell_type": "code", "execution_count": 232, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "C:\n", "o\n", "ame\n" ] } ], "source": [ "path = 'C:\\no\\name'\n", "print(path)" ] }, { "cell_type": "code", "execution_count": 233, "metadata": {}, "outputs": [], "source": [ "line = ' \\t joerg 666\\n'" ] }, { "cell_type": "code", "execution_count": 234, "metadata": {}, "outputs": [], "source": [ "match_expression = r'^\\s*(\\S+)\\s*(\\d+)\\s*$'" ] }, { "cell_type": "code", "execution_count": 235, "metadata": {}, "outputs": [], "source": [ "import re" ] }, { "cell_type": "code", "execution_count": 236, "metadata": {}, "outputs": [], "source": [ "compiled_expression = re.compile(match_expression)" ] }, { "cell_type": "code", "execution_count": 237, "metadata": {}, "outputs": [], "source": [ "match = compiled_expression.search(line)" ] }, { "cell_type": "code", "execution_count": 238, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'joerg'" ] }, "execution_count": 238, "metadata": {}, "output_type": "execute_result" } ], "source": [ "match.group(1)" ] }, { "cell_type": "code", "execution_count": 239, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'666'" ] }, "execution_count": 239, "metadata": {}, "output_type": "execute_result" } ], "source": [ "match.group(2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### String Methods" ] }, { "cell_type": "code", "execution_count": 240, "metadata": {}, "outputs": [], "source": [ "s = 'mississippi'" ] }, { "cell_type": "code", "execution_count": 241, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 241, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.count('ss')" ] }, { "cell_type": "code", "execution_count": 242, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 242, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.find('ss')" ] }, { "cell_type": "code", "execution_count": 243, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 243, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.find('ss', 3)" ] }, { "cell_type": "code", "execution_count": 244, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-1" ] }, "execution_count": 244, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.find('xxx')" ] }, { "cell_type": "code", "execution_count": 245, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 245, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.index('ss')" ] }, { "cell_type": "code", "execution_count": 246, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " substring not found\n" ] } ], "source": [ "try:\n", " s.index('xxx')\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 247, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 247, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'XXX'.isupper()" ] }, { "cell_type": "code", "execution_count": 248, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 248, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'xxx'.islower()" ] }, { "cell_type": "code", "execution_count": 249, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 249, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'file.csv'.endswith('.csv')" ] }, { "cell_type": "code", "execution_count": 250, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 250, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'file.csv'.startswith('file')" ] }, { "cell_type": "code", "execution_count": 251, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 251, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'abc123'.isalnum()" ] }, { "cell_type": "code", "execution_count": 252, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' *** '" ] }, "execution_count": 252, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'***'.center(100)" ] }, { "cell_type": "code", "execution_count": 253, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'mississippi'" ] }, "execution_count": 253, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s" ] }, { "cell_type": "code", "execution_count": 254, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 254, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s.rfind('ss')" ] }, { "cell_type": "code", "execution_count": 255, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'xxx'" ] }, "execution_count": 255, "metadata": {}, "output_type": "execute_result" } ], "source": [ "' xxx '.strip()" ] }, { "cell_type": "code", "execution_count": 256, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' xxx'" ] }, "execution_count": 256, "metadata": {}, "output_type": "execute_result" } ], "source": [ "' xxx '.rstrip()" ] }, { "cell_type": "code", "execution_count": 257, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'xxx '" ] }, "execution_count": 257, "metadata": {}, "output_type": "execute_result" } ], "source": [ "' xxx '.lstrip()" ] }, { "cell_type": "code", "execution_count": 258, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'abc'" ] }, "execution_count": 258, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'123 abc 1 2 3 '.strip(' 123')" ] }, { "cell_type": "code", "execution_count": 259, "metadata": {}, "outputs": [], "source": [ "line = 'root:x:0:0:Super User:/root:/bin/bash\\n'" ] }, { "cell_type": "code", "execution_count": 260, "metadata": {}, "outputs": [], "source": [ "line = line.rstrip()" ] }, { "cell_type": "code", "execution_count": 261, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'root:x:0:0:Super User:/root:/bin/bash'" ] }, "execution_count": 261, "metadata": {}, "output_type": "execute_result" } ], "source": [ "line" ] }, { "cell_type": "code", "execution_count": 262, "metadata": {}, "outputs": [], "source": [ "elems = line.split(':')" ] }, { "cell_type": "code", "execution_count": 263, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'root'" ] }, "execution_count": 263, "metadata": {}, "output_type": "execute_result" } ], "source": [ "elems[0]" ] }, { "cell_type": "code", "execution_count": 264, "metadata": {}, "outputs": [], "source": [ "name, passwd, uid, gid, descr, home, loginshell = line.split(':')" ] }, { "cell_type": "code", "execution_count": 265, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'root'" ] }, "execution_count": 265, "metadata": {}, "output_type": "execute_result" } ], "source": [ "name" ] }, { "cell_type": "code", "execution_count": 266, "metadata": {}, "outputs": [], "source": [ "l = ['xxx', 'yyy', 'zzz']" ] }, { "cell_type": "code", "execution_count": 267, "metadata": {}, "outputs": [], "source": [ "joined_l = '-'.join(l)" ] }, { "cell_type": "code", "execution_count": 268, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['xxx', 'yyy', 'zzz']" ] }, "execution_count": 268, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 269, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'xxx-yyy-zzz'" ] }, "execution_count": 269, "metadata": {}, "output_type": "execute_result" } ], "source": [ "joined_l" ] }, { "cell_type": "code", "execution_count": 270, "metadata": {}, "outputs": [], "source": [ "line = 'root:x:0:0:Super User:/root:/bin/bash\\n'" ] }, { "cell_type": "code", "execution_count": 271, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['root', 'x', '0:0:Super User:/root:/bin/bash\\n']" ] }, "execution_count": 271, "metadata": {}, "output_type": "execute_result" } ], "source": [ "line.split(':', 2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More About Lists" ] }, { "cell_type": "code", "execution_count": 272, "metadata": {}, "outputs": [], "source": [ "l = ['a', 'b', 'c']" ] }, { "cell_type": "code", "execution_count": 273, "metadata": {}, "outputs": [], "source": [ "l.append('d')" ] }, { "cell_type": "code", "execution_count": 274, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['a', 'b', 'c', 'd']" ] }, "execution_count": 274, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 275, "metadata": {}, "outputs": [], "source": [ "l.extend(['e', 'f'])" ] }, { "cell_type": "code", "execution_count": 276, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['a', 'b', 'c', 'd', 'e', 'f']" ] }, "execution_count": 276, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 277, "metadata": {}, "outputs": [], "source": [ "l.extend('ghi')" ] }, { "cell_type": "code", "execution_count": 278, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']" ] }, "execution_count": 278, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 279, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "g\n", "h\n", "i\n" ] } ], "source": [ "for c in 'ghi':\n", " print(c)" ] }, { "cell_type": "code", "execution_count": 280, "metadata": {}, "outputs": [], "source": [ "l.extend(range(3, 6))" ] }, { "cell_type": "code", "execution_count": 281, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 3, 4, 5]" ] }, "execution_count": 281, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 282, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 'int' object is not iterable\n" ] } ], "source": [ "try:\n", " l.extend(666)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 283, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 'int' object is not iterable\n" ] } ], "source": [ "try:\n", " for i in 666:\n", " print(i)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 284, "metadata": {}, "outputs": [], "source": [ "rv = l.append(100)" ] }, { "cell_type": "code", "execution_count": 285, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "NoneType" ] }, "execution_count": 285, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(rv)" ] }, { "cell_type": "code", "execution_count": 286, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "None\n" ] } ], "source": [ "print(rv)" ] }, { "cell_type": "code", "execution_count": 287, "metadata": {}, "outputs": [], "source": [ "def f(): pass" ] }, { "cell_type": "code", "execution_count": 288, "metadata": {}, "outputs": [], "source": [ "rv = f()" ] }, { "cell_type": "code", "execution_count": 289, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "None\n" ] } ], "source": [ "print(rv)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More About Dictionaries" ] }, { "cell_type": "code", "execution_count": 290, "metadata": {}, "outputs": [], "source": [ "d = {'one': 1,\n", " 'two': 2,\n", " }" ] }, { "cell_type": "code", "execution_count": 291, "metadata": {}, "outputs": [], "source": [ "rv = d.get('three')" ] }, { "cell_type": "code", "execution_count": 292, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "None\n" ] } ], "source": [ "print(rv)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 293, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n" ] } ], "source": [ "rv = d.get('three')\n", "if rv:\n", " print(rv)\n", "else:\n", " print(3)" ] }, { "cell_type": "code", "execution_count": 294, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3\n" ] } ], "source": [ "rv = d.get('three', 3)\n", "print(rv)" ] }, { "cell_type": "code", "execution_count": 295, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4\n" ] } ], "source": [ "rv = d.get('four')\n", "if rv is not None:\n", " print(rv)\n", "else:\n", " d['four'] = 4\n", " rv = d.get('four')\n", " print(rv)" ] }, { "cell_type": "code", "execution_count": 296, "metadata": {}, "outputs": [], "source": [ "rv = d.setdefault('five', 5)" ] }, { "cell_type": "code", "execution_count": 297, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "5\n" ] } ], "source": [ "print(rv)" ] }, { "cell_type": "code", "execution_count": 298, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1, 'two': 2, 'four': 4, 'five': 5}" ] }, "execution_count": 298, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 299, "metadata": {}, "outputs": [], "source": [ "d2 = {'five': 5.5, 'six': 6, 'seven': 7.0}" ] }, { "cell_type": "code", "execution_count": 300, "metadata": {}, "outputs": [], "source": [ "d.update(d2)" ] }, { "cell_type": "code", "execution_count": 301, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1, 'two': 2, 'four': 4, 'five': 5.5, 'six': 6, 'seven': 7.0}" ] }, "execution_count": 301, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 302, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['one', 'two', 'four', 'five', 'six', 'seven']" ] }, "execution_count": 302, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(d.keys())" ] }, { "cell_type": "code", "execution_count": 303, "metadata": {}, "outputs": [], "source": [ "d[666] = 'crap'" ] }, { "cell_type": "code", "execution_count": 304, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1,\n", " 'two': 2,\n", " 'four': 4,\n", " 'five': 5.5,\n", " 'six': 6,\n", " 'seven': 7.0,\n", " 666: 'crap'}" ] }, "execution_count": 304, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 305, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one\n", "two\n", "four\n", "five\n", "six\n", "seven\n", "666\n" ] } ], "source": [ "for elem in d:\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 306, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one\n", "two\n", "four\n", "five\n", "six\n", "seven\n", "666\n" ] } ], "source": [ "for key in d.keys():\n", " print(key)" ] }, { "cell_type": "code", "execution_count": 307, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "2\n", "4\n", "5.5\n", "6\n", "7.0\n", "crap\n" ] } ], "source": [ "for v in d.values():\n", " print(v)" ] }, { "cell_type": "code", "execution_count": 308, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "('one', 1)\n", "('two', 2)\n", "('four', 4)\n", "('five', 5.5)\n", "('six', 6)\n", "('seven', 7.0)\n", "(666, 'crap')\n" ] } ], "source": [ "for elem in d.items():\n", " print(elem)" ] }, { "cell_type": "code", "execution_count": 309, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "one 1\n", "two 2\n", "four 4\n", "five 5.5\n", "six 6\n", "seven 7.0\n", "666 crap\n" ] } ], "source": [ "for k, v in d.items():\n", " print(k, v)" ] }, { "cell_type": "code", "execution_count": 310, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{}" ] }, "execution_count": 310, "metadata": {}, "output_type": "execute_result" } ], "source": [ "{}" ] }, { "cell_type": "code", "execution_count": 311, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1, 'two': 2}" ] }, "execution_count": 311, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dict([('one', 1), ('two', 2)])" ] }, { "cell_type": "code", "execution_count": 312, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'one': 1, 'two': 2}" ] }, "execution_count": 312, "metadata": {}, "output_type": "execute_result" } ], "source": [ "{\n", " 'one': 1,\n", " 'two': 2,\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## More About Sets" ] }, { "cell_type": "code", "execution_count": 313, "metadata": {}, "outputs": [], "source": [ "s = set()" ] }, { "cell_type": "code", "execution_count": 314, "metadata": {}, "outputs": [], "source": [ "s.add(42)" ] }, { "cell_type": "code", "execution_count": 315, "metadata": {}, "outputs": [], "source": [ "s.add('abc')" ] }, { "cell_type": "code", "execution_count": 316, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{42, 'abc'}" ] }, "execution_count": 316, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s" ] }, { "cell_type": "code", "execution_count": 317, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 317, "metadata": {}, "output_type": "execute_result" } ], "source": [ "42 in s" ] }, { "cell_type": "code", "execution_count": 318, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " unhashable type: 'list'\n" ] } ], "source": [ "try:\n", " s.add([1,2,'drei'])\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 319, "metadata": {}, "outputs": [], "source": [ "i = 666" ] }, { "cell_type": "code", "execution_count": 320, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "666" ] }, "execution_count": 320, "metadata": {}, "output_type": "execute_result" } ], "source": [ "hash(i)" ] }, { "cell_type": "code", "execution_count": 321, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "666" ] }, "execution_count": 321, "metadata": {}, "output_type": "execute_result" } ], "source": [ "i.__hash__()" ] }, { "cell_type": "code", "execution_count": 322, "metadata": {}, "outputs": [], "source": [ "l = [1, 2, 'drei']" ] }, { "cell_type": "code", "execution_count": 323, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " unhashable type: 'list'\n" ] } ], "source": [ "try:\n", " hash(l)\n", "except Exception as e:\n", " print(type(e), e)" ] }, { "cell_type": "code", "execution_count": 324, "metadata": {}, "outputs": [], "source": [ "list.__dict__.get('__hash__')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Comprehensions (List, Dictionary, Set)" ] }, { "cell_type": "code", "execution_count": 325, "metadata": {}, "outputs": [], "source": [ "l = [0, 1, 2, 3, 4, 5]" ] }, { "cell_type": "code", "execution_count": 326, "metadata": {}, "outputs": [], "source": [ "l = list(range(6))" ] }, { "cell_type": "code", "execution_count": 327, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 2, 3, 4, 5]" ] }, "execution_count": 327, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 328, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 4, 9, 16, 25]" ] }, "execution_count": 328, "metadata": {}, "output_type": "execute_result" } ], "source": [ "squares = []\n", "for elem in l:\n", " squares.append(elem**2)\n", "squares" ] }, { "cell_type": "code", "execution_count": 329, "metadata": {}, "outputs": [], "source": [ "squares = [elem**2 for elem in l]" ] }, { "cell_type": "code", "execution_count": 330, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 4, 9, 16, 25]" ] }, "execution_count": 330, "metadata": {}, "output_type": "execute_result" } ], "source": [ "squares" ] }, { "cell_type": "code", "execution_count": 331, "metadata": {}, "outputs": [], "source": [ "even_squares = [elem**2 for elem in l if elem%2 == 0]" ] }, { "cell_type": "code", "execution_count": 332, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 4, 16]" ] }, "execution_count": 332, "metadata": {}, "output_type": "execute_result" } ], "source": [ "even_squares" ] }, { "cell_type": "code", "execution_count": 333, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 2, 3, 4, 5]" ] }, "execution_count": 333, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l" ] }, { "cell_type": "code", "execution_count": 334, "metadata": {}, "outputs": [], "source": [ "d = {}" ] }, { "cell_type": "code", "execution_count": 335, "metadata": {}, "outputs": [], "source": [ "for elem in l:\n", " d[elem] = elem**2" ] }, { "cell_type": "code", "execution_count": 336, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}" ] }, "execution_count": 336, "metadata": {}, "output_type": "execute_result" } ], "source": [ "d" ] }, { "cell_type": "code", "execution_count": 337, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}" ] }, "execution_count": 337, "metadata": {}, "output_type": "execute_result" } ], "source": [ "{elem: elem**2 for elem in l}" ] }, { "cell_type": "code", "execution_count": 338, "metadata": {}, "outputs": [], "source": [ "s = set()\n", "for elem in l:\n", " s.add(elem**2)" ] }, { "cell_type": "code", "execution_count": 339, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0, 1, 4, 9, 16, 25}" ] }, "execution_count": 339, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s" ] }, { "cell_type": "code", "execution_count": 340, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{0, 1, 4, 9, 16, 25}" ] }, "execution_count": 340, "metadata": {}, "output_type": "execute_result" } ], "source": [ "{elem**2 for elem in l}" ] }, { "cell_type": "code", "execution_count": 341, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 4, 9, 16, 25]" ] }, "execution_count": 341, "metadata": {}, "output_type": "execute_result" } ], "source": [ "squares = []\n", "for elem in l:\n", " squares.append(elem**2)\n", "squares" ] }, { "cell_type": "code", "execution_count": 342, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0, 1, 4, 9, 16, 25]" ] }, "execution_count": 342, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[elem**2 for elem in l]" ] }, { "cell_type": "code", "execution_count": 343, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "4\n", "9\n", "16\n", "25\n" ] } ], "source": [ "for num in [elem**2 for elem in l]:\n", " print(num)" ] }, { "cell_type": "code", "execution_count": 344, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "4\n", "9\n", "16\n", "25\n" ] } ], "source": [ "for num in (elem**2 for elem in l):\n", " print(num)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## File I/O" ] }, { "cell_type": "code", "execution_count": 345, "metadata": {}, "outputs": [], "source": [ "f = open('/etc/passwd', encoding='utf-8')" ] }, { "cell_type": "code", "execution_count": 346, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "root:x:0:0:Super User:/root:/bin/bash\n", "bin:x:1:1:bin:/bin:/usr/sbin/nologin\n", "daemon:x:2:2:daemon:/sbin:/usr/sbin/nologin\n", "adm:x:3:4:adm:/var/adm:/usr/sbin/nologin\n", "lp:x:4:7:lp:/var/spool/lpd:/usr/sbin/nologin\n", "sync:x:5:0:sync:/sbin:/bin/sync\n", "shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\n", "halt:x:7:0:halt:/sbin:/sbin/halt\n", "mail:x:8:12:mail:/var/spool/mail:/usr/sbin/nologin\n", "operator:x:11:0:operator:/root:/usr/sbin/nologin\n", "games:x:12:100:games:/usr/games:/usr/sbin/nologin\n", "ftp:x:14:50:FTP User:/var/ftp:/usr/sbin/nologin\n", "nobody:x:65534:65534:Kernel Overflow User:/:/usr/sbin/nologin\n", "dbus:x:81:81:System Message Bus:/:/usr/sbin/nologin\n", "apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin\n", "tss:x:59:59:Account used for TPM access:/:/usr/sbin/nologin\n", "systemd-coredump:x:998:998:systemd Core Dumper:/:/usr/sbin/nologin\n", "systemd-network:x:192:192:systemd Network Management:/:/usr/sbin/nologin\n", "systemd-oom:x:997:997:systemd Userspace OOM Killer:/:/usr/sbin/nologin\n", "systemd-resolve:x:193:193:systemd Resolver:/:/usr/sbin/nologin\n", "systemd-timesync:x:996:996:systemd Time Synchronization:/:/usr/sbin/nologin\n", "qemu:x:107:107:qemu user:/:/sbin/nologin\n", "polkitd:x:114:114:User for polkitd:/:/sbin/nologin\n", "avahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin\n", "geoclue:x:995:994:User for geoclue:/var/lib/geoclue:/sbin/nologin\n", "nm-openconnect:x:994:993:NetworkManager user for OpenConnect:/:/sbin/nologin\n", "usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin\n", "gluster:x:993:992:GlusterFS daemons:/run/gluster:/sbin/nologin\n", "rtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin\n", "pipewire:x:992:990:PipeWire System Daemon:/run/pipewire:/usr/sbin/nologin\n", "saslauth:x:991:76:Saslauthd user:/run/saslauthd:/sbin/nologin\n", "chrony:x:990:989:chrony system user:/var/lib/chrony:/sbin/nologin\n", "dnsmasq:x:989:988:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/usr/sbin/nologin\n", "rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin\n", "rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin\n", "openvpn:x:988:987:OpenVPN:/etc/openvpn:/sbin/nologin\n", "nm-openvpn:x:987:986:Default user for running openvpn spawned by NetworkManager:/:/sbin/nologin\n", "colord:x:986:985:User for colord:/var/lib/colord:/sbin/nologin\n", "unbound:x:985:984:Unbound DNS resolver:/var/lib/unbound:/sbin/nologin\n", "abrt:x:173:173::/etc/abrt:/sbin/nologin\n", "flatpak:x:984:982:Flatpak system helper:/:/usr/sbin/nologin\n", "gdm:x:42:42:GNOME Display Manager:/var/lib/gdm:/usr/sbin/nologin\n", "gnome-initial-setup:x:983:981::/run/gnome-initial-setup/:/sbin/nologin\n", "vboxadd:x:982:1::/var/run/vboxadd:/sbin/nologin\n", "sshd:x:74:74:Privilege-separated SSH:/usr/share/empty.sshd:/usr/sbin/nologin\n", "tcpdump:x:72:72:tcpdump:/:/usr/sbin/nologin\n", "jfasch:x:1000:1000:Jörg Faschingbauer:/home/jfasch:/bin/bash\n" ] } ], "source": [ "for line in f:\n", " print(line, end='')" ] }, { "cell_type": "code", "execution_count": 347, "metadata": {}, "outputs": [], "source": [ "f = open('/etc/passwd', encoding='utf-8')" ] }, { "cell_type": "code", "execution_count": 348, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'root:'" ] }, "execution_count": 348, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.read(5)" ] }, { "cell_type": "code", "execution_count": 349, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'x:0:0'" ] }, "execution_count": 349, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.read(5)" ] }, { "cell_type": "code", "execution_count": 350, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "':Super User:/root:/bin/bash\\n'" ] }, "execution_count": 350, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.readline()" ] }, { "cell_type": "code", "execution_count": 351, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'bin:x:1:1:bin:/bin:/usr/sbin/nologin\\n'" ] }, "execution_count": 351, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.readline()" ] }, { "cell_type": "code", "execution_count": 352, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'daemon:x:2:2:daemon:/sbin:/usr/sbin/nologin\\nadm:x:3:4:adm:/var/adm:/usr/sbin/nologin\\nlp:x:4:7:lp:/var/spool/lpd:/usr/sbin/nologin\\nsync:x:5:0:sync:/sbin:/bin/sync\\nshutdown:x:6:0:shutdown:/sbin:/sbin/shutdown\\nhalt:x:7:0:halt:/sbin:/sbin/halt\\nmail:x:8:12:mail:/var/spool/mail:/usr/sbin/nologin\\noperator:x:11:0:operator:/root:/usr/sbin/nologin\\ngames:x:12:100:games:/usr/games:/usr/sbin/nologin\\nftp:x:14:50:FTP User:/var/ftp:/usr/sbin/nologin\\nnobody:x:65534:65534:Kernel Overflow User:/:/usr/sbin/nologin\\ndbus:x:81:81:System Message Bus:/:/usr/sbin/nologin\\napache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin\\ntss:x:59:59:Account used for TPM access:/:/usr/sbin/nologin\\nsystemd-coredump:x:998:998:systemd Core Dumper:/:/usr/sbin/nologin\\nsystemd-network:x:192:192:systemd Network Management:/:/usr/sbin/nologin\\nsystemd-oom:x:997:997:systemd Userspace OOM Killer:/:/usr/sbin/nologin\\nsystemd-resolve:x:193:193:systemd Resolver:/:/usr/sbin/nologin\\nsystemd-timesync:x:996:996:systemd Time Synchronization:/:/usr/sbin/nologin\\nqemu:x:107:107:qemu user:/:/sbin/nologin\\npolkitd:x:114:114:User for polkitd:/:/sbin/nologin\\navahi:x:70:70:Avahi mDNS/DNS-SD Stack:/var/run/avahi-daemon:/sbin/nologin\\ngeoclue:x:995:994:User for geoclue:/var/lib/geoclue:/sbin/nologin\\nnm-openconnect:x:994:993:NetworkManager user for OpenConnect:/:/sbin/nologin\\nusbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin\\ngluster:x:993:992:GlusterFS daemons:/run/gluster:/sbin/nologin\\nrtkit:x:172:172:RealtimeKit:/proc:/sbin/nologin\\npipewire:x:992:990:PipeWire System Daemon:/run/pipewire:/usr/sbin/nologin\\nsaslauth:x:991:76:Saslauthd user:/run/saslauthd:/sbin/nologin\\nchrony:x:990:989:chrony system user:/var/lib/chrony:/sbin/nologin\\ndnsmasq:x:989:988:Dnsmasq DHCP and DNS server:/var/lib/dnsmasq:/usr/sbin/nologin\\nrpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin\\nrpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin\\nopenvpn:x:988:987:OpenVPN:/etc/openvpn:/sbin/nologin\\nnm-openvpn:x:987:986:Default user for running openvpn spawned by NetworkManager:/:/sbin/nologin\\ncolord:x:986:985:User for colord:/var/lib/colord:/sbin/nologin\\nunbound:x:985:984:Unbound DNS resolver:/var/lib/unbound:/sbin/nologin\\nabrt:x:173:173::/etc/abrt:/sbin/nologin\\nflatpak:x:984:982:Flatpak system helper:/:/usr/sbin/nologin\\ngdm:x:42:42:GNOME Display Manager:/var/lib/gdm:/usr/sbin/nologin\\ngnome-initial-setup:x:983:981::/run/gnome-initial-setup/:/sbin/nologin\\nvboxadd:x:982:1::/var/run/vboxadd:/sbin/nologin\\nsshd:x:74:74:Privilege-separated SSH:/usr/share/empty.sshd:/usr/sbin/nologin\\ntcpdump:x:72:72:tcpdump:/:/usr/sbin/nologin\\njfasch:x:1000:1000:Jörg Faschingbauer:/home/jfasch:/bin/bash\\n'" ] }, "execution_count": 352, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.read()" ] }, { "cell_type": "code", "execution_count": 353, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "''" ] }, "execution_count": 353, "metadata": {}, "output_type": "execute_result" } ], "source": [ "f.read(1)" ] }, { "cell_type": "code", "execution_count": 354, "metadata": {}, "outputs": [], "source": [ "f = open('/etc/passwd', 'rb')" ] }, { "cell_type": "code", "execution_count": 355, "metadata": {}, "outputs": [], "source": [ "b = f.read(5)" ] }, { "cell_type": "code", "execution_count": 356, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "bytes" ] }, "execution_count": 356, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(b)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data Science" ] }, { "cell_type": "code", "execution_count": 357, "metadata": {}, "outputs": [], "source": [ "import pandas" ] }, { "cell_type": "code", "execution_count": 360, "metadata": {}, "outputs": [], "source": [ "df = pandas.read_csv('meine-cpu.csv', delimiter=';')" ] }, { "cell_type": "code", "execution_count": 370, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
hwmon2hwmon4hwmon5hwmon7hwmon8
037.8541.041.049.030.0
137.8540.040.042.031.0
237.8541.041.043.031.0
337.8541.041.043.031.0
437.8541.041.043.031.0
..................
8343.8578.078.059.032.0
8444.8576.076.067.032.0
8544.8575.075.071.032.0
8644.8574.074.066.033.0
8744.8573.073.067.033.0
\n", "

88 rows × 5 columns

\n", "
" ], "text/plain": [ " hwmon2 hwmon4 hwmon5 hwmon7 hwmon8\n", "0 37.85 41.0 41.0 49.0 30.0\n", "1 37.85 40.0 40.0 42.0 31.0\n", "2 37.85 41.0 41.0 43.0 31.0\n", "3 37.85 41.0 41.0 43.0 31.0\n", "4 37.85 41.0 41.0 43.0 31.0\n", ".. ... ... ... ... ...\n", "83 43.85 78.0 78.0 59.0 32.0\n", "84 44.85 76.0 76.0 67.0 32.0\n", "85 44.85 75.0 75.0 71.0 32.0\n", "86 44.85 74.0 74.0 66.0 33.0\n", "87 44.85 73.0 73.0 67.0 33.0\n", "\n", "[88 rows x 5 columns]" ] }, "execution_count": 370, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": 371, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 37.85\n", "1 37.85\n", "2 37.85\n", "3 37.85\n", "4 37.85\n", "5 37.85\n", "6 37.85\n", "Name: hwmon2, dtype: float64" ] }, "execution_count": 371, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['hwmon2'][0:7]" ] }, { "cell_type": "code", "execution_count": 363, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 49.0\n", "1 42.0\n", "2 43.0\n", "3 43.0\n", "4 43.0\n", " ... \n", "83 59.0\n", "84 67.0\n", "85 71.0\n", "86 66.0\n", "87 67.0\n", "Name: hwmon7, Length: 88, dtype: float64" ] }, "execution_count": 363, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['hwmon7']" ] }, { "cell_type": "code", "execution_count": 364, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "88" ] }, "execution_count": 364, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df)" ] }, { "cell_type": "code", "execution_count": 365, "metadata": {}, "outputs": [], "source": [ "x = range(88)" ] }, { "cell_type": "code", "execution_count": 366, "metadata": {}, "outputs": [], "source": [ "y = df['hwmon7']" ] }, { "cell_type": "code", "execution_count": 367, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 368, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 368, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAigAAAGdCAYAAAA44ojeAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8g+/7EAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSJklEQVR4nO3deXhU5dk/8O+ZNSHLhBCykoSwyS5IWIK4R9Bqi5VXxaJFxbVoBVqt/CraWhWlb6ultbgj1oVKq1T7VhCx4hYSFkFlXyIJhEwIIZmss57fHzPnzEz2hJnMnHO+n+vKpcxMJo+MOXPP/dz3/QiiKIogIiIiiiK6SC+AiIiIqDUGKERERBR1GKAQERFR1GGAQkRERFGHAQoRERFFHQYoREREFHUYoBAREVHUYYBCREREUccQ6QX0hsfjQUVFBRISEiAIQqSXQ0RERN0giiLq6+uRmZkJna7zHIkiA5SKigpkZ2dHehlERETUC+Xl5Rg0aFCnj1FkgJKQkADA+x+YmJgY4dUQERFRd9hsNmRnZ8vv451RZIAibeskJiYyQCEiIlKY7pRnsEiWiIiIog4DFCIiIoo6DFCIiIgo6jBAISIioqjDAIWIiIiiDgMUIiIiijoMUIiIiCjqMEAhIiKiqMMAhYiIi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/Vq9eLT+mublZ/NnPfib2799f7Nevn/jjH/9YPHnyZOQWrWGtAxS+NpH1wQcfiGPHjhXNZrM4cuRI8cUXXwy63+PxiMuWLRPT0tJEs9ksXnbZZeKBAwcitFrtsNls4v333y/m5OSIMTEx4pAhQ8Rf//rXot1ulx/D1yaYIIoBY+yIiIiIogBrUIiIiCjqMEAhIiKiqMMAhYiIiKIOAxQiIiKKOgxQiIiIKOowQCEiIqKowwCFiIiIog4DFCIiIoo6DFCIiIgo6jBAISIioqjDAIWIiIiiDgMUIiIiijr/H8Xd9KfkIfV6AAAAAElFTkSuQmCC", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plt.plot(x, y)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.1" } }, "nbformat": 4, "nbformat_minor": 4 }