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. …
Regular Expression (aka Regex) is one of the most important and common in any programming languages. Of course, this also applies to Python. Python has some quite unique regex usage patterns compared to other programming languages.
In this article, I’ve organised 7 useful tips regarding the regex in Python for you. They are either little tricks that can improve your productivity, solve some complex problems or improve your code readability. Hope they’ll be helpful!
Python string is one of the most basic but powerful and comprehensive objects. Even though you might a learner, I bet you should know the format function and f-strings. One of my previous articles has introduced all these functions.
However, this is one feature of Python strings that rarely people know about it. That is the string template. I would not recommend to use it in general tasks, especially for Data Science/Analysis ad-hoc jobs, it is totally not relevant. …
I guess you must know that Python is famous as it is straight forward. You don’t need to write many lines of code to implement your ideas. Also, because of the thriving of the community, there are many open-sourced libraries that keep extending this characteristic of Python. You can literally do a lot of things with a few lines of code. Here are some examples:
In recent years, Python is known by a lot more people who are not programmers. This is not only because of its popularity in the area of Machine Learning but also because it could be used to automate a lot of repetitive works such as bulk editing files with certain patterns.
In one of my previous articles (as follows), I have introduced the OS library in Python which will handle almost all the basic file system operations. These operations are highly recommended for those who have just started their journey to use Python to automate some repetitive tasks.
Recent years, Python is known by a lot more people who are not programmers. This is not only because of its popularity in the area of Machine Learning but also because it could be used to automate a lot of repetitive works such as bulk editing files with certain patterns.
When the automation tasks are related to files, it is important to master the file system interfaces in Python. In this article, I’ll introduce 8 file system operations in Python that are the most important and essential. Hope it can guide some learners to have an easier start.
As one of the most widely used “Pythonic” syntax in Python, you must have ever heard List Comprehension or have already used it frequently. It is almost a must-have section in various Python elementary tutorials. However, did you know that there are actually 4 types of “comprehension” in Python rather than only for the lists? You may also have heard or ever used Dictionary Comprehension, but might not for the set and generator.
In this article, I’ll introduce all the 4 types comprehensions in Python with examples. In the last section, I also want to give an example to show…
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.
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…