Skip to main content

One post tagged with "python"

View All Tags

· 4 min read
at15

My friend working at a bank wanted to learn Python and I (using Java at work) wanted to learn Python again for machine learning. I thought I could learn python better by teaching another person. I figured it might help people with similar background (e.g. teach your partner who wants to try software related jobs), so I decided to write a series of blog posts to document the 'course' I designed and material used.

Syllabus

There are many python tutorial, book and open courses online, but I want to design a course that is more related to my friend's background (working at bank) so he can practice using things he learned and find the knowledge useful and get into a positive feedback loop. Otherwise, I would be forcing him to recite concepts and telling him these will be used eventually like my calculus teacher in university.

He learned programming when he was at university a decade ago and now he only remembers HTML... So the plan is to start from the very basic and cover the daily tooling of a software engineer such as using terminal, git/github, writing markdown. Tooling related with programming is a very curial part that I found missing in intro courses back at university. Version track, write document is not only important for collaborating with other people at work, it is also important for side project with only one author (and one user...) because you may pick the project up one year later and need to figure out what your were doing ASAP before you give up again.

The syllabus is divided into chapters, though length of content increases in later chapters. The schedule is 3h offline sync per week and there was no plan on when we will finish. I will adjust the content based on our progress.

Prepare development environment

  • Terminal
    • common shell commands, ls, cd, cat, vi
    • accepting input and output from command line
    • make the calculator an executable you can run like other programs
  • Git and GitHub
    • Create a GitHub account
    • Track code using git from GUI/terminal
    • Use GitHub codespace, vscode for both local and remote development
  • Use the REPL, run python file and Jupiter Notebook

Language itself

  • Hello world using a tax/mortgage calculator
    • variable
    • control flow, if, for
    • function, argument, return, scope of variables inside function
  • Basic data structure for tracking a person's monthly expense
    • list
    • dict
    • draw plot, if it works w/o Jupyter Notebook then we can still stick with cli
  • Class, model behavior of a company, e.g. generic employee, manager, worker, ceo etc.

Algorithms

  • brute force
  • complexity, O(N)
  • recursion
  • binary search (for dive and conquer)
  • dfs/bfs on graph/tree (we can use dict and switch to class later)
  • LeetCode

Maintainability

  • Test, unit test
  • Package, dependency and version management

Application

  • Web
    • Crawl other website
    • A simple web service
      • Make previous mortgage calculator a website
      • use other packages
    • Use a database, use sqlite because we introduce docker later
      • First start with implementing everything in memory and see if it will cause any issue (gone after restart)
  • Cloud
    • Docker for development and packaging
    • Deploy the website to GCP/AWS using free tier
  • ML, predict person spending, stock price etc.
    • Jupyter Notebook
    • numpy, pandas
    • scikit-learn, linear regression etc.
    • pytorch
    • llm

References