{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![Py4Eng](sessions/img/logo.png)\n", "\n", "# Python for Engineers\n", "## [Yoav Ram](http://python.yoavram.com)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Day 1: Introduction to Python\n", "\n", "- Why Python?\n", "- Types & operators: [notebook](sessions/types-operators.ipynb)\n", "- If & while: [notebook](sessions/if-while.ipynb)\n", "- Strings, lists, and loops: [notebook](sessions/strings-lists-loops.ipynb)\n", "- Dictionaries: [notebook](sessions/dictionaries.ipynb)\n", "- Functions: [notebook](sessions/functions.ipynb)\n", "- Memory model: [notebook](sessions/memory-model.ipynb)\n", "- Errors & exceptions: [notebook](sessions/exceptions.ipynb)\n", "\n", "#### Homework\n", "\n", "1. [Largest product in a series](https://projecteuler.net/problem=8)\n", "2. [Largest product in a grid](https://projecteuler.net/problem=11)\n", "3. [Longest Collatz series](https://projecteuler.net/problem=14)\n", "4. [Lexicographic permutations](https://projecteuler.net/problem=24)\n", "5. [Goldbach\\\"s other conjecture](https://projecteuler.net/problem=46)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Day 2: Advanced topics in Python\n", "\n", "- I/O: [notebook](sessions/io.ipynb)\n", "- Modules & package managers: [notebook](sessions/modules.ipynb)\n", "- Comprehensions, iterators, generators: [notebook](sessions/iteration.ipynb)\n", "- Object oriented programming: [notebook](sessions/oop.ipynb)\n", "\n", "#### Homework\n", "\n", "6. [Max overlap concatenation](http://www.cs.tau.ac.il/courses/pyProg/1415a/hw/hw8/ex8.zip)\n", "7. [Shellsort (includes solution, scroll gently)](http://interactivepython.org/runestone/static/pythonds/SortSearch/TheShellSort.html)\n", "8. [The cipher challenge, stage 1: Simple Monoalphabetic Substitution\n", "Cipher](http://simonsingh.net/cryptography/cipher-challenge/the-ciphertexts/stage-1/)\n", "9. [Ray-casting algorithm](http://rosettacode.org/wiki/Ray-casting_algorithm)\n", "10. [Miller-Rabin primality test](http://rosettacode.org/wiki/Miller%E2%80%93Rabin_primality_test)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Day 3: Introduction to Scientific Python\n", "\n", "- Numerical Python with NumPy: [notebook](sessions/numpy.ipynb) | [solution](solutions/numpy.ipynb)\n", "- Plotting with Matplotlib: [notebook](sessions/matplotlib.ipynb) | [solution](solutions/matplotlib.ipynb)\n", "- Data analysis with Pandas and Seaborn: [notebook](sessions/pandas-seaborn.ipynb) | [solution](solutions/pandas-seaborn.ipynb)\n", "\n", "#### Homework\n", "1. Do at least 25 of these [100 NumPy exercises](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises.ipynb) | [solution](https://github.com/rougier/numpy-100/blob/master/100_Numpy_exercises_with_solutions.md)\n", "2. Pandas and Seaborn: [assignment](exercises/pandas-seaborn-ex.ipynb) | [solution](solutions/pandas-seaborn-ex.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Day 4: Scientific Computing with Python\n", "1. [Linear algebra](sessions/linear-algebra.ipynb)\n", "1. [Calculus](sessions/calculus.ipynb)\n", "1. [Optimization](sessions/optimization.ipynb)\n", "1. [Curve fitting](sessions/curve-fitting.ipynb)\n", "1. [Image processing](sessions/image-processing.ipynb)\n", "1. [High-performance computing with Cython and Numba](sessions/cython-numba.ipynb)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Day 5: Machine Learning with Python\n", "1. K-nearest neighbors: [notebook](sessions/KNN.ipynb) | [solution](solutions/KNN.ipynb) | [movies](sessions/movies.ipynb)\n", "1. Linear regression: [notebook](sessions/regression.ipynb) | [solution](solutions/scikit-learn.ipynb)\n", "1. [Decision trees and random forest](sessions/trees.ipynb)\n", "1. PCA & clustering: [notebook](sessions/PCA.ipynb) | [solution](solutions/PCA.ipynb)\n", "1. NN? Bayes?\n", "\n", "### Exercises\n", "1. K-nearest neighbors: [notebook](exercises/KNN_seeds.ipynb) | [solution](solutions/KNN_seeds.ipynb)\n", "1. Linear regression: [notebook](exercises/linear-model.ipynb) | [solution](solutions/linear-model.ipynb)\n", "1. Lasso: [notebook](exercises/lasso.ipynb) | [solution](solutions/lasso.ipynb)\n", "1. Logistic regression: [notebook](exercises/logistic-tennis.ipynb) | [solution](solutions/logistic-tennis.ipynb)\n", "1. Trees: [notebook](exercises/trees.ipynb) | [solution](solutions/trees.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting help\n", "\n", "- Use autocompletion by pressing `Tab`. \n", " - In the middle of a word it will try to finish the variable name.\n", " - Just after a dot (`.`) it will try to bring up a menu of methods and attributes; the variable before the dot must already be defined.\n", "- Use documentation by pressing `Shift+Tab`; this is especially useful inside a function parentheses as it will show the function arguments, but it can be used anywhere. Again, variables must already be defined." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Terminal\n", "\n", "To open a terminal inside Jupyter, choose `File->New...->Terminal` in the top menu." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Monitoring CPU\n", "\n", "To monitor CPU of your programs:\n", "- Open a terminal window (see above).\n", "- Run `htop`.\n", "- If `htop` is not available, you can install another program: `python -m pip install glances` and then run `glances -1 -4`." ] } ], "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.9.2" } }, "nbformat": 4, "nbformat_minor": 4 }