Python

Python Built-In Functions

Python comes with many built-in functions you can use without importing any library. Here are they in alphabetical order: Built-in Functions abs() delattr() hash() memoryview() set() all() dict() help() min() setattr() any() dir() hex() next() slice() ascii() divmod() id() object() sorted() bin() enumerate() input() oct() staticmethod() bool() eval() int() open() str() breakpoint() exec() isinstance() ord() …

Python Built-In Functions Read More »

Exponential Fit with SciPy’s curve_fit()

In this article, you’ll explore how to generate exponential fits by exploiting the curve_fit() function from the Scipy library. SciPy’s curve_fit() allows building custom fit functions with which we can describe data points that follow an exponential trend. In the first part of the article, the curve_fit() function is used to fit the exponential trend …

Exponential Fit with SciPy’s curve_fit() Read More »

Christian Mayer

Chris is the founder of the programming education company FINXTER, author of the Coffee Break Python series of self-published books, the popular programming book Python One-Liners (NoStarch 2020), a doctorate computer scientist, and owner of one of the top 10 Python blogs worldwide. His research interests include graph theory and distributed systems. You can join …

Christian Mayer Read More »

Show Don’t Tell: Commenting Python Best Practices

This tutorial taken from my upcoming programming book “From One to Zero” (NoStarch, 2021) will show you how to write great comments. While most online tutorials focus on a bullet list of commenting tips, we dive deeper into the meat exploring the underlying reasons for the commonly recommended commenting principles. So, let’s get started! Code …

Show Don’t Tell: Commenting Python Best Practices Read More »

Six Figure Coder

Freelance Developer – How to Code From Home and Earn Six Figures [Industry Report]

What keeps you going day after day? Your motivation is the most important building block of your success. In the following, I’d like to give you some fact-based motivation why creating your coding business online can easily be the most rewarding decision in your life.  Yet, motivation is not everything. If you want to make …

Freelance Developer – How to Code From Home and Earn Six Figures [Industry Report] Read More »

Matplotlib Line Plot – A Helpful Illustrated Guide

The line plot is the most iconic of all the plots. To draw one in matplotlib, use the plt.plot() function and pass it a list of numbers used as the y-axis values. Per default, the x-axis values are the list indexes of the passed line. Matplotlib automatically connects the points with a blue line per …

Matplotlib Line Plot – A Helpful Illustrated Guide Read More »

Matplotlib Scatter Plot – Simple Illustrated Guide

Scatter plots are a key tool in any Data Analyst’s arsenal. If you want to see the relationship between two variables, you are usually going to make a scatter plot.  In this article, you’ll learn the basic and intermediate concepts to create stunning matplotlib scatter plots. Minimal Scatter Plot Example The following code shows a …

Matplotlib Scatter Plot – Simple Illustrated Guide Read More »

How to Catch and Print Exception Messages in Python

Python comes with an extensive support of exceptions and exception handling. An exception event interrupts and, if uncaught, immediately terminates a running program. The most popular examples are the IndexError, ValueError, and TypeError. An exception will immediately terminate your program. To avoid this, you can catch the exception with a try/except block around the code …

How to Catch and Print Exception Messages in Python Read More »