Starting your Python journey

Hello learners,

These are suggestions to kick-start your Python journey.

  • A1 & 2 & 4 are about learning resources and exercises.
  • A3 is about finding/setting up a coding environment.
  • A4 & 5 are highlighted coding skills.
  • B1 & 2 & 3 are official tutorials for some popular data science packages that are also used in MLS
  • B4 is how we help ourselves in daily work when a problem comes up.
  • C is a step-to-step guide to try reading and understanding the labs. If you are completely new, then very likely it will require a lot of patience and trials. You will need to go through a lot of cycles like “reading → understanding → building up expectation of what the code should return → run the code and observe the result → compare the result with expectation”. This is not easy, but are you ready?

A. Getting familiar with the syntax of Python

  1. If you love courses, search “Python” on coursera and set the “Beginner” filter.

  2. If you want to learn from text tutorial, let me quote some resources from Python.org:

    1. Here is a list of English tutorials. I checked out the first few and they all cover the basics you will need. Just pick any one to start with.

    2. Here is a list of resources in other languages.

    3. Charlie @ctbwx shared this excellent site https://pyflo.net/. It offers a pathway that guides you through the completions of many basic and important programming concepts and Python skills. It presented the pathway in a interactive, trackable learning progress flow chart. Try it and feel free to share your comments here! (Charlie’s post)

  3. You may want to find a place to start writing some code, here are some options sorted from least to more effort, and they will all end up an environment very similar to coursera’s:

    1. Write it on your coursera notebook, but you will lose access after subscription ends

    2. Google Colab, with Google Drive as the persistent storage.

    3. Install “Jupyter Lab” on your computer. For installation instructions, google “Install jupyter lab on XXX” and replace “XXX” with your OS’s name.

  4. Here is a very long list of various types of Python exercises you may practice with yourself.

  5. Indentation is a usual source of errors in learner’s assignments. Most Python tutorials should cover about indentation, but if you want a quick demo for how indentation works, check this out.

  6. Some learners are very interested in format specifiers like {variable_name:0.2e}. For this, please check out this doc page for a full explanation of how you can format a number into a string.

B. Getting familiar with popular data science packages

  1. Matplotlib. For visualization. Check this official tutorial out, or these videos shared in this post by @Mano_Bharathi_M

  2. Numpy. For manuplating dataset in any dimensions. Check this official tutorial out for the basics and more advanced numpy skills

  3. Tensorflow. For building neural networks. Check this official tutorial out for different levels of tutorial. Audit this if you prefer a course.

  4. Tutorials above let us learn a package at a time to get familiar with it.

    1. In practice when we are not sure what a package’s function does, we can google e.g. “numpy reshape” to check out numpy’s documentation for the function reshape. The documentation usually comes with a good explanation and some examples so they are must-read. I frequently visit documentation even I have been using these packages for years.

    2. If we have a goal but not sure how to implement the goal with the package, we can google example code or find solution on stackoverflow.

C. Reading the optional lab and assignment

  1. Read the text description carefully, and any formula that comes along. This course is about algorithms, so a key purpose for some labs/assignments is to convert formula into code. Understand the formula, plug in some numbers and calculate the outcome by hand. The outcome is what you can expect from the code when it correcly implements the formula.

  2. With the expectation (either by formula or by text description) in mind, read the code, understand it, run it, and see whether the result is as you expected.

  3. If not, play with the code, modify some values, under the goal to single out exactly which smallest part of the code has syntax that works out of your expectation. Google that part for more explanations, discussions and examples. After you come up with a new theory, go back to step 1 again.

  4. Assignment’s ungraded code cells are mostly locked because changing them might lead to submission related problems. Locked cells mean you can’t play with them unless you unlock the cells. Therefore, I suggest you to experiment more with the optional labs (no cells are locked), or unlock the assignment’s code cell and play with them only after you have a passing submission.

  5. After experimentations, you might want to get a new copy of the lab in its original state, and these are the steps to follow, during which you will need to rename your current notebook, before the system can get you a new copy.

22 Likes

This is fantastic! Thank you for taking the time to share these resources. I just finished up the Supervised Learning course and was wondering about additional resources to get more practice. I’m glad I found this!

You are welcome, @Marc_Jaramillo :slight_smile:

Raymond