Python RegEx – Match Whitespace But Not Newline

Problem Formulation πŸ’¬ Challenge: How to design a regular expression pattern that matches whitespace characters such as the empty space ‘ ‘ and the tabular character ‘\t’, but not the newline character ‘\n’? An example of this would be to replace all whitespaces (except newlines) between a space-delimited file with commas to obtain a CSV. … Read more

Python One Line Pattern

Problem Formulation You appear at an interview, and the interviewer intends to test your skills in writing concise one-line solutions. So he decides to present you with a long and complex-looking piece of code that is seemingly intimidating and asks you to come up with one-line solutions for the given code. Given: Challenges: Guess the … Read more

How to Convert Space-Delimited File to CSV in Python?

The easiest way to convert a space-delimited file to a comma-separated values (CSV) file is to use the following three lines of code: import pandas as pd df = pd.read_csv(‘my_file.txt’, sep=’\s+’, header=None) df.to_csv(‘my_file.csv’, header=None) We’ll explain this and other approaches in more detail next—scroll down to Method 3 for this exact method. Problem Formulation Given … Read more

How to Repeat a String Multiple Times in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to repeat a string multiple times in Python. Over your career as a Python coder, you will encounter situations when a string needs to be output/displayed a specified number of times. The examples below offer you various ways to accomplish this task. πŸ’¬ Question: … Read more

NumPy Datetime: How to Work with Dates and Times in Python?

Dates and times have come a long way since the hourglass was invented

In this article, we’ll be learning about something that is literally everywhere. Whatever corner you turn, whatever street you run down, you can’t get away from it. It is as ubiquitous as the physical space around us. Yes today, we’re talking about… TIME. More specifically, we’re talking about NumPy’s functions that represent dates and times. … Read more

Decentralized Finance for Coders [Free Video Course]

This course will show you the ins and outs of decentralized finance (DeFi). Each step links to a more detailed article/tutorial, so you can dive deeper into the rabbit hole. Let’s get started! Step 1: Getting Started with DeFi What is DeFi? Decentralized Finance, also referred to as β€œDeFi,” enables customers to access financial services … Read more

MakerDAO 101 for Coders – How DeFi Lending and Borrowing Works

This is in continuation of the first part of our DeFi series. πŸ’‘ Abstract: In this article, we will see how decentralized lending and borrowing work. It starts with comparing centralized finance (CeFi) with decentralized finance (DeFi) lending and borrowing. You’ll then learn about the most important Ethereum based DeFi decentralized apps (dapps) for lending … Read more

The Magic of Neural Networks: History and Concepts

Artificial neural networks have become a powerful tool providing many benefits in our modern world. They are used to filter out spam, perform voice recognition, play games, and drive cars, among many other things. As remarkable as these tools are, they are readily within the grasp of almost anyone. If you have technical interest and … Read more

How to Display a Progress Bar in Python

[😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁😁] 100% Problem Formulation and Solution Overview In this article, you’ll learn how to configure and display a progress bar. A progress bar is commonly used in Python or, for that matter, any other programming language to show the user an application’s progress. For example, an installation, a transferring of files, or any other commands. … Read more