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 +
. In this article, I’ll introduce what’s the differences between these two approaches and why you should not use +
.
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 classification purposes. However, it can also be used to predict continuous numeric values. In this article, I am going to introduce a specific type of decision tree s— the regression tree. …
As a Data Scientist, a Data Analyst or a Data Engineer, Pandas must be one of the most commonly used libraries in Python. It can print the Data Frame in a pretty HTML styled format for us, which is one of its major features if you’re using Jupyter Notebook/Lab or Google Colab like me.
Because Pandas use pre-defined HTML + CSS, we don’t need to worry about the format ourselves. However, sometimes we may want it to display in some format that other than its default one. You probably know that we can set pd.options.display
to achieve this.
I have some many learners who know this but don’t remember the options every time they want to use. Well, there are 30+ different options in the pd.options.display
sub-category only. So, it is definitely not necessary to remember them all. …
If you are a Data Scientist or a Data Engineer using Python as your primary programming language, I believe you must use Jupyter Notebook. As the “next-generation” web-based application for Jupyter Notebook, Jupyter Lab provides much more convenient features than its old bother. One of them is the extensions.
Now, even the Jupyter Lab development team is excited to have such a robust and thrive third-party extension community. In this article, I’ll introduce 10 Jupyter Lab extensions that I found are very useful to dramatically improve the productivity of a typical data scientist or data engineer.
Most of the online resource will tell you to run the command like the following to install a Jupyter Lab extension. …
Like most of the other programming languages, Python has many common iterables such as list (usually called array in other languages), set and dictionary. However, there is such a “Pythonic” iterable that is not quite common, which is “zip”.
This “zip” is not for compressing, but should be understood as its shallow meaning: fasten the objects in two or more iterables (such as lists). In this article, I’m going to introduce
I believe you must have ever seen if __name__ == '__main__'
in some Python source code repo, application or libraries. You may or may not know what it is, because you definitely don’t need it if you’re a typical data scientist who uses Jupyter Notebook most of the time. Or, you may simply imitate to use this expression even though it is not quite sure what it does, just like me when I started to learn Python :)
In this article, I’ll introduce you what does it do, how does it work and when to use it. …
“String” is one of the most important data types in most of the programming languages, so it is in Python. Most programming languages will provide many built-in functions/methods to help programmers manipulate strings more easily, such as replacing, splitting and so on.
Python is a programming language that is famous because it provides a lot of features out-of-box. This is true in almost every single aspect. I often see people writing Python code regarding string manipulations but they are actually “re-inventing” the wheels. …
One of the most unique features of the Python programming language is the decorator. That is the at sign “@” you may have seen it everywhere in Python code. Of course, many other languages have decorator as well, but the concepts are different. In Python, the decorator can be defined extremely easily and utilised for any functions and classes.
It’s like a “wrapper” of the functions or classes that we used to add more behaviours of them without changing them. It is very useful when we want to
Are you using the terminal more than GUI-based operating systems? Or, do you usually develop command-line interface programs using Python? Recently, I found an amazing Python library called “Rich” on GitHub, which already has 15.2k stars by the time I’m writing this article.
It can not only display text in colour and styles in the terminal but also emoji, tables, progress bars, markdown and even syntax highlighted code. If you have read one of my previous articles below:
The “Rich” library can almost do everything that I have introduced in that article, as well as some other awesome stuff.
In this article, I’ll introduce this library with examples to show its capabilities. …
Yes, I’ll be started to share some self-improvement and professional working environment advice since now. If you are one of the followers of mine or have ever seen my articles before, you might be surprised why I’m starting to share knowledge in these topics given that I am a technical guy?
I am a data solution architect, data engineer and machine learning engineer. So, my day-to-day responsibilities are usually providing suggestions and implementing solutions, which seems that writing a meeting summary should not be part of my job. …