How to Extract Numbers from a String

Problem Formulation and Solution Overview In this article, you’ll learn how to extract numbers from a string in Python. To make it more fun, we have the following running scenario: This article references an Albanian proverb written by Driton Selmani in 2012. We will leave the interpretation up to you. 💬 Question: How would we … Read more

How to Add a Column to a CSV

Problem Formulation and Solution Overview In this article, you’ll learn how to add a new column to a CSV file in Python. To make it more fun, we have the following running scenario: The owner of the Finxter Academy has asked you to add a new column to their existing CSV file called Total_Chrgs. 💬 … Read more

How to Print Italic Text in Python?

You can change your text to bold, italic, and underlined in Python. Not only can you play around with the style of your code but also change its color with the help of specific packages and modules in Python. Interesting! Isn’t it? There are different ways of doing this. By the end of this tutorial, … Read more

Maximum Recursion Depth in Python  

What is Recursion? Recursion in programming is a problem-solving concept. In recursion, a function finds the solution by calling itself once or many times. This function call can be explicit or implicit. 💡Info: Recursion, according to (Tang 2013), is when a function or algorithm calls itself one or more times. These calls occur until the … Read more

Distributed Systems Engineer — Income and Opportunity

Before we learn about the money, let’s get this question out of the way: What Is a Distributed System? A distributed system is a computer system spread across multiple computing devices connected via a communication network. Each participating device takes over part of the overall work performed by the system. By means of the collaboration … Read more

Security Engineer — Income and Opportunity

Before we learn about the money, let’s get this question out of the way: What Does a Security Engineer Do? A security engineer is a “white-hat hacker”, i.e., an IT professional who analyzes computer systems and computer networks to ensure they are running securely. This involves proactive analysis and understanding of possible security threats and … Read more

np.where() – A Simple Illustrated Guide

Python’s numpy.where(condition, x, y) function returns an array with elements from x where condition is True, and elements from y elsewhere.  When simply calling numpy.where(condition), it is the shorthand of np.asarray(condition).nonzero() and returns a tuple containing the indices of elements that meets the condition for each dimension. If it sounds great to you, please continue … Read more

How to Add Time Onto a Datetime Object in Python

Problem: Given a datetime.datetime object in Python, is there a way to add time to the given datetime object? Related Question on StackOverflow: Discussion: Adding time to a datetime object in Python should lead to a new datetime object with the updated time information. For example, if you add 5 hours to a datetime object … Read more

How to Print Bold Text in Python?

Summary: To print bold text in Python, you can use: The simple_color package, The ‘\033[1m’ ANSI escape-sequence, The termcolor module, The coloroma package, The prompt_toolkit package. A simple, no-library way to print bolded text in Python is to enclose a given string s in the special escape sequence like so: print(“\033[1m” + s + “\033[0m”). … Read more