java 

How to Do a Binary Search in Python

Binary search is a classic algorithm in computer science. It often comes up in programming contests and technical interviews. Implementing binary search turns out to be a challenging task, even when you understand the concept. Unless you’re curious or have a specific assignment, you should always leverage existing libraries to do a binary search in Python or any other language. In this tutorial, you’ll learn how to: Use the bisect module to do a binary search in Python Implement a binary search in Python both recursively and iteratively Recognize and…

Read More

PyDev of the Week: Tommy Falgout

This week we welcome Tommy Falgout (@lastcoolname) as our PyDev of the Week! Tommy works on the Robo-Clippy project. You can see what else he is up to by checking out his website. Let’s take a few moments to get to know Tommy better! Can you tell us a little about yourself (hobbies, education, etc): I grew up in the bayous of Louisiana, and while everyone else was interested in 4-wheeling and hunting, I gravitated towards computers and spent hours on my Commodore 64.  Early on, I knew what it…

Read More
java 

Python vs Go – Which Language You Should Choose

Both Python and Go are extremely relevant today. Both languages are widely used. However, many people have been switching from Python to the newer and faster language Golang, also known as Go. Go is a much newer language than Python, released by Google in 2009, and it has many advantages over many other programming languages. Golang is an excellent language, although not so one-sidedly better than Python that Python will go away any time soon. Python, released back in 1991, still is the dominant 800-pound gorilla in the space with…

Read More
java 

Erik Marsja: How to Convert a Pandas DataFrame to a NumPy Array

The post How to Convert a Pandas DataFrame to a NumPy Array appeared first on Erik Marsja. In this short Python Pandas tutorial, we will learn how to convert a Pandas dataframe to a NumPy array.  Specifically, we will learn how easy it is to transform a dataframe to an array using the two methods values and to_numpy, respectively. Furthermore, we will also learn how to import data from an Excel file and change this data to an array. Now, if we want to carry out some high-level mathematical functions…

Read More
java 

What are Regular Expressions Used For? 10 Applications

The web is full of tutorials about regular expressions. But I realized that most of those tutorials lack a thorough motivation. Why do regular expressions exist? What are they used for? What are some practical applications? Somehow, the writers of those tutorials believe that readers are motivated by default to learn a technology that’s complicated and hard to learn. Well, readers are not. If you’re like me, you tend to avoid complexity and you first want to know WHY before you invest dozens of hours learning a new skill. Is…

Read More

PyDev of the Week: Hameer Abbasi

This week we welcome Hameer Abbasi as our PyDev of the Week! Hameer works on the PyData Sparse project. You can check out what else Hameer is working on over on Github. Let’s take some time to get to know him better! Can you tell us a little about yourself (hobbies, education, etc): My hobby is, and has been for a while, scientific computing in general, the ecosystem and how to make it better. I’m lucky and grateful to have found a job in that same field, even though my…

Read More
java 

Python Re Groups

This tutorial explains everything you need to know about matching groups in Python’s re package for regular expressions. You may have also read the term “capture groups” which points to the same concept. As you read through the tutorial, you can also watch the tutorial video where I explain everything in a simple way: So let’s start with the basics: Matching Group () What’s a matching group? Like you use parentheses to structure mathematical expressions, (2 + 2) * 2 versus 2 + (2 * 2), you use parentheses to…

Read More

Mike Driscoll: PyDev of the Week: Hameer Abbasi

This week we welcome Hameer Abbasi as our PyDev of the Week! Hameer works on the PyData Sparse project. You can check out what else Hameer is working on over on Github. Let’s take some time to get to know him better! Can you tell us a little about yourself (hobbies, education, etc): My hobby is, and has been for a while, scientific computing in general, the ecosystem and how to make it better. I’m lucky and grateful to have found a job in that same field, even though my…

Read More

Real Python: Null in Python: Understanding Python's NoneType Object

If you have experience with other programming languages, like C or Java, then you’ve probably heard of the concept of null. Many languages use this to represent a pointer that doesn’t point to anything, to denote when a variable is empty, or to mark default parameters that you haven’t yet supplied. null is often defined to be 0 in those languages, but null in Python is different. Python uses the keyword None to define null objects and variables. While None does serve some of the same purposes as null in…

Read More

Robin Parmar: A review of Processing books

Processing is the free and open Java development environment that targets artists who are intrigued by generative code. In essence it is the Java language with a friendly development interface and built-in libraries to get you started. There are plenty of ways to learn Processing, including the tutorials on the organisation’s website, and the built-in examples that come with the distribution. But if you prefer a printed book, keep reading. This article will review nine available publications, so you can make an informed purchase decision. For the sake of completeness…

Read More