Sign in

👁️2M+ Reads🏆5.2k+ Followers🥇Top 50 Writer👨‍🎓PhD💻Data Engineer/Machine Learning 🤝LinkedIn
Photo by tcausley on Pixabay

A comparison of the approaches for joining strings in Python, using “+” and join() method.

When I start to use Python, it is very intuitive and easy to come out to use the plus operator + to join string, as many programming languages do such as Java.

However, soon I realised that many developers seem to like to use the .join() method rather than +

Photo by GregMontani on Pixabay

Machine Learning

Introduction to the Regression Tree Model without formulas, equations, and scientific statements

This article is meant to explain the regression tree machine learning model without any buzzwords and scientific expressions, so you don’t need any pre-requisite knowledge or a Computer Science/Math degree to understand it.

As one of the most commonly used machine learning models, a decision tree is usually used for…

Image by Joshua Woroniecki from Pixabay

Not only listing but also the examples and considerations.

A few days ago, Python 3.10 has released eventually. There are already many articles online that were even published before it was released. However, I found most of those are just listing the new features without too much discussion. Therefore, in my article, I'll try to give some examples about…

Image by John Leong from Pixabay

A hidden gem — Python functools + decorator

In one of my previous blogs, I have introduced one decorator in Python functools which can cache the intermediate results for recursive functions and web requests automatically. All we need to do is just adding a decorator to the function definition.

In this article, I’ll introduce three more useful features…

Image by Tumisu from Pixabay

Those mysterious behaviours of Python need to be noticed

Every programming language will have some weird behaviours. Those are usually not because of bugs or faults but are more likely to be the decision about some dilemma. Just like when we are facing some options, by choosing one item usually means give up the possibilities provided by others. …

Image by Free-Photos from Pixabay

The unexpected running outcomes for Dictionary, Try Except and For-Loop

One of my favourite leisure activities is wandering on Stack Overflow. There are many interesting questions over there about Python. Indeed, some of the questions we may never meet in our life. However, the knowledge behind it is quite interesting, which is even more interesting than the question itself.


Image by Michael Mosimann from Pixabay

Common problems in Python code that are usually neglected

As Python becomes more and more popular, the number of Python users is also boosting. Python is indeed relatively easy to learn. It is also very flexible so that there are more possible ways to achieve one function.

However, whenever there are multiple ways of doing a particular thing, it…

Image by Here and now, unfortunately, ends my journey on Pixabay from Pixabay

Keep your Python objects being referenced, or they will be released in memory.

Every programming language will have its particular mechanisms for garbage collection. This is referring to those unused variables which still occupy some space in the memory that will be eventually removed. This is important in terms of utilising the memory space more efficiently.

Have you ever thought about how the…

Image by Vagelis Dimas from Pixabay

Special Python literal constants make your program faster and more Pythonic

As long as you are a Python developer, you must have used the List. It is the most commonly used container type in Python. Also, I guess you must know that we can use the paired square brackets [] to initialise an empty list.

This article actually starts with a…

Image by NastasyaDay from Pixabay

Built-in function tools in Python help us to cache

If you do programming a lot, you must know that one programming principle is “Do Not Repeat Yourself”. That is at the coding level. We should not repeat if we can generalise.

However, the topic I’m going to discuss is “Do Not Repeat Computing”. That is, if we have already…

Christopher Tao

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store