Python Multi-Line Strings

Challenge: How to create a multi-line string in Python? In this tutorial, I’ll show you four methods to create and maintain multi-line strings in Python. The most Pythonic ones are the first two methods with triple single quotes ”’ … ”’ or triple double quotes “”” … “”” that wrap a string across multiple lines. … Read more

How to Get Started With Python Dash on PyCharm [Absolute Beginners]

This is a chapter draft of our book Python Dash with NoStarch: Why an IDE Using an integrated development environment (IDE) has the potential to significantly accelerate your programming productivity. Many programmers do not unlock their full potential until they finally decide to switch from a simple code editor to an IDEβ€”and mastering the advanced … Read more

29+ Killer Resources on Learning Python [Collection]

Python is one of the most popular programming language according to a recent IEEE Spectrum article. In this article, we compiled the best resources to learn Python for you— whether you’re a beginner, intermediate, or professional Python developer. ALL LINKS OPEN IN A NEW TAB! Python and Computer Science Puzzles Cheat Sheets Online Tutorials Online … Read more

Lambda Calculus in Python

This tutorial introduces an advanced language feature: lambda functions. Lambda functions are rooted in the mathematical area of lambda calculus. One of the pioneers of this area was Alonzo Church. He introduced lambda functions in 1936 even before the appearance of the first computers. Lambda functions exist in a wide range of languages for functional … Read more

Apache Spark – A Short Overview

Large companies analyze massive amounts of data coming from various sources such as social nets, weblogs, or customers. An important class of data analytics concerns large-scale set operations. Suppose you have two customer data sets A and B. Set A contains all customers who bought in 2017. Set B contains all customers who bought in … Read more

Matplotlib Widgets — Creating Interactive Plots with Sliders

This article describes how to generate interactive plots by using the .widgets package from the matplotlib library. As can be inferred from the name, the .widgets package allows creating different types of interactive buttons, which can be used for modifying what is displayed in a matplotlib graph. In particular, this article will focus on the … Read more

Python — How to Modify a Sequence While Iterating over It?

Modifying a sequence while iterating over it can cause undesired behavior due to the way the iterator is build. To avoid this problem, a simple solution is to iterate over a copy of the list. For example, you’ll obtain a copy of list_1 by using the slice notation with default values list_1[:]. Because you iterate … Read more

[Numpy * Operator] Element-wise Multiplication in Python

NumPy is a popular Python library for data science. Numpy focuses on array, vector, and matrix computations. If you work with data, you cannot avoid NumPy. So learn it now and learn it well. In this tutorial, you’ll learn how to calculate the Hadamard Product (= element-wise multiplication) of two 1D lists, 1D arrays, or … Read more