Algorithms

The Reduce Function in Python 3: Simply Explained

💡 The reduce() function from Python’s functools module aggregates an iterable to a single element. It repeatedly merges two iterable elements into a single one as defined in the function argument. By repeating this, only a single element will remain — the return value. Minimal Example Here’s the minimal example: The code performs the following steps: …

The Reduce Function in Python 3: Simply Explained Read More »

How to Convert a String List to an Integer List in Python

The most Pythonic way to convert a list of strings to a list of ints is to use the list comprehension [int(x) for x in strings]. It iterates over all elements in the list and converts each list element x to an integer value using the int(x) built-in function. This article shows you the simplest …

How to Convert a String List to an Integer List in Python Read More »

How to Convert a String List to a Float List in Python

The most Pythonic way to convert a list of strings to a list of floats is to use the list comprehension floats = [float(x) for x in strings]. It iterates over all elements in the list and converts each list element x to a float value using the float(x) built-in function. This article shows you …

How to Convert a String List to a Float List in Python Read More »

How to Convert an Integer List to a Float List in Python

The most Pythonic way to convert a list of integers ints to a list of floats is to use the list comprehension expression floats = [float(x) for x in ints]. It iterates over all elements in the list ints using list comprehension and converts each list element x to a float value using the float(x) …

How to Convert an Integer List to a Float List in Python Read More »

How to Convert a Float List to a String List in Python

The most Pythonic way to convert a list of floats fs to a list of strings is to use the one-liner fs = [str(x) for x in fs]. It iterates over all elements in the list fs using list comprehension and converts each list element x to a string value using the str(x) constructor. This …

How to Convert a Float List to a String List in Python Read More »

How to Convert an Integer List to a String List in Python

The most Pythonic way to convert a list of integers ints to a list of strings is to use the one-liner strings = [str(x) for x in ints]. It iterates over all elements in the list ints using list comprehension and converts each list element x to a string value using the str(x) constructor. This …

How to Convert an Integer List to a String List in Python Read More »

How to Run TensorFlow in a Jupyter Notebook?

If you are a machine learning practitioner you might have come across the TensorFlow library. TensorFlow is a popular machine learning library and finds its use in a lot of AI and machine learning applications. In this tutorial you will learn How to install TensorFlow in a virtual environment How to activate your environment in …

How to Run TensorFlow in a Jupyter Notebook? Read More »

Striving for Collective Intelligence

The idea I’m going to tell you is well-researched but little-known. And it’s meta. Thinking about it has become my main passion, life mission, and purpose. It’s how I see the world. In short: what drives me is increasing collective intelligence. Collective Intelligence is Everywhere You are not one individual but many individual cells that are …

Striving for Collective Intelligence Read More »

Writing Clean Code — Being a Professional [Cheat Sheet + Video]

Download the cheat sheet here (direct PDF download): Have you ever asked yourself, “What does it mean to be a professional?” This article is about being a professional software developer. It is based on the book, Clean Code by Robert C. Martin. All quotations are from this book.  While reading this article, you will learn …

Writing Clean Code — Being a Professional [Cheat Sheet + Video] Read More »

What are the Applications of Graphs in Computer Science?

[Reading time: 9 minutes] Graphs are everywhere. They are used in social networks, the world wide web, biological networks, semantic web, product recommendation engines, mapping services, blockchains, and Bitcoin flow analyses. Furthermore, they’re used to define the flow of computation of software programs, to represent communication networks in distributed systems, and to represent data relationships …

What are the Applications of Graphs in Computer Science? Read More »