Python Basic and Advanced (22.3.2021 - 25.3.2021) ================================================= .. contents:: :local: .. sidebar:: *Training Information* **Material** * :doc:`/trainings/material/soup/python/basics/group` * :doc:`/trainings/material/soup/python/advanced/group` * :doc:`/trainings/material/soup/python/swdev/group` **Source Code** `See Github `__ Agenda ------ * Day 1: Programming Basics * Variables * Control Flow: ``if``, ``while``, ``for`` * Functions * Exercises * Day 2: Python, Advanced * Data Structures: ``list``, ``set``, ``dict`` * Iteration * File I/O (CSV Files?) * Exercises * Day 3: even more advanced * Object Oriented Programming * Unit Testing * Decorators * Exercises * Day 4: Consulting Jupyter Notebook ---------------- .. sidebar:: Download :download:`Notebook.ipynb` .. toctree:: Notebook Log --- We're lagging behind what's in the agenda, don't want to lose anybody. Day 1 ..... * Basics from the slides, up until ``if`` (see :doc:`here `) * :doc:`/trainings/material/soup/python/exercises/herdt/max_numbers` Solution, doing everything by hand ... .. literalinclude:: code/maximum-potschert.py :caption: :download:`code/maximum-potschert.py` :language: python Solution, knowing about the ``map()`` `function `__ and the ``max()`` `function `__ .. literalinclude:: code/maximum-gscheit.py :caption: :download:`code/maximum-gscheit.py` :language: python Day 2 ..... * :doc:`Exercise: digit translation ` .. literalinclude:: code/digit.py :caption: :download:`code/digit.py` :language: python * ``while`` * :doc:`Exercise: primeness (using while) ` .. literalinclude:: code/prime-while.py :caption: :download:`code/prime-while.py` :language: python * ``for``, ``range()`` * :doc:`Exercise: primeness (using for) ` .. literalinclude:: code/prime-for.py :caption: :download:`code/prime-for.py` :language: python * Functions * :doc:`Exercise: primeness (function) ` .. literalinclude:: code/prime-function.py :caption: :download:`code/prime-function.py` :language: python * :doc:`Exercise: uniq function ` .. literalinclude:: code/uniq.py :caption: :download:`code/uniq.py` :language: python * Large group exercise (extending until course finish). Something with CSV files. File IO for a purpose. Day 3 ..... Cold start in the morning: * ``uniq()`` transformed into *generator* * ``with`` * ``is`` Continue with the group exercise. Moved the code over to Github last evening, starting with a short `Git intro `__. * Using ``csv.DictReader``; see `here `__ * Group exercise on `Github `__ Day 4 ..... * Use ``collections.namedtuple`` for our ``dict`` objects that we use as *records*. * Test driven development * OO * :doc:`/trainings/material/soup/python/misc/mqtt/topic` Links ----- * :doc:`Python/NumPy course by myself, including links <../2019-11-12/index>` * `SciPy: Interpolation `__ * `Pandas: read_excel() `__. Makes sense to look into: the ``converters`` parameter, for example, looks like it would offer a cool opportunity to hook in our dumb ``str("123,456")`` (note the *comma*) -> ``float(123.456)`` conversions. * :doc:`Virtual Environments `, and :doc:`Python Package Index (PyPI) ` (Tutorial) Videos ----------------- * .. raw:: html * .. raw:: html * .. raw:: html * .. raw:: html * .. raw:: html * .. raw:: html * .. raw:: html