Return Keyword in Python – A Simple Illustrated Guide

Python’s return keyword commands the execution flow to exit a function immediately and return a value to the caller of the function. You can specify an optional return value—or even a return expression—after the return keyword. If you don’t provide a return value, Python will return the default value None to the caller. Python Return … Read more

Python dir() — A Simple Guide with Video

If used without argument, Python’s built-in dir() function returns the function and variable names defined in the local scope—the namespace of your current module. If used with an object argument, dir(object) returns a list of attribute and method names defined in the object’s scope. Thus, dir() returns all names in a given scope. Usage Learn … Read more

Python dict() — A Simple Guide with Video

Python’s built-in dict() function creates and returns a new dictionary object from the comma-separated argument list of key = value mappings. For example, dict(name = ‘Alice’, age = 22, profession = ‘programmer’) creates a dictionary with three mappings: {‘name’: ‘Alice’, ‘age’: 22, ‘profession’: ‘programmer’}. A dictionary is an unordered and mutable data structure, so it … Read more

Top 10 Python Freelancer Resources on Finxter

In this article, I’m going to compile the top ten Python freelancer resources on the Finxter website. [Article] How to Go Full-Time ($3000/m) as a Python Freelancer In this article, you are going to learn my exact strategy how to earn $3000 per month as a Python freelancer without actually working full-time and without sacrificing … Read more

Python Scipy signal.find_peaks() — A Helpful Guide

This article deals with the analysis and processing of signals, more specifically on how to identify and calculate the peaks contained in a given signal. Motivation Being able to identify and hence work with the peaks of a signal is of fundamental importance in lots of different fields, from electronics to data science and economics. … Read more

Python Dash: How to Build a Beautiful Dashboard in 3 Steps

Data visualization is an important toolkit for a data scientist. Building beautiful dashboards is an important skill to acquire if you plan to show your insights to a C-Level executive. In this blog post, you will get an introduction to a visualization framework in Python. You will learn how to build a dashboard from fetching … Read more

Python Join Arguments and String Concatenation

Problem: Write a function that joins an arbitrary number of string arguments with a given separator. Example: Given the string arguments “A”, “B”, and “C” and the string separator “-“. Join them to the concatenated string “A-B-C”. Solution: The following code creates a Python function concat() that takes an arbitrary number of arguments, packs them … Read more

Python getattr()

Python’s built-in getattr(object, string) function returns the value of the object‘s attribute with name string. If this doesn’t exist, it returns the value provided as an optional third default argument. If that doesn’t exist either, it raises an AttributeError. An example is getattr(porsche, ‘speed’) which is equivalent to porsche.speed. Usage Learn by example! Here’s an … Read more

Creating Beautiful Heatmaps with Seaborn

Heatmaps are a specific type of plot which exploits the combination of color schemes and numerical values for representing complex and articulated datasets. They are largely used in data science application that involves large numbers, like biology, economics and medicine. In this video we will see how to create a heatmap for representing the total … Read more

Python setattr()

Python’s built-in setattr(object, string, value) function takes three arguments: an object, a string, and an arbitrary value. It sets the attribute given by the string on the object to the specified value. After calling the function, there’s a new or updated attribute at the given instance, named and valued as provided in the arguments. For … Read more