The Inofficial Freelance Developer Tax Guide [for Hackers]

Taxes are the most significant expense for you as a business owner and as a private person alike. Do you want to create your thriving freelancing business? Congratulations, this has been the best decision in my professional life—and it’s rewarding to earn more money per time spent (Python freelancer average is $61 per hour), be … Read more

Python Program zur Berechnung der Deutschen Einkommensteuer

Das folgende Python Program implementiert eine einfache Faustformel zur Berechnung der Einkommensteuer in Deutschland: Hier ist ein einfaches Schaubild, dass das Verhältnis von zu versteuertem Einkommen (zvE) und der geschätzten Steuerlast darstellt: Der folgende Python code wurde zur Berechnung dieses Schaubilds herangezogen: Dies ist nur eine Heuristic von dieser Quelle—es scheint aber relativ korrekt zu … Read more

Python Getpass Module: A Simple Guide + Video

The Python getpass module provides portable password input functionality and allows you to accept an input string in a command-line interface (CLI) without the string being typed from being visible (echoed) in the interface. The getpass module also includes a getuser function for retrieving a username from the relevant environment variables. In this getpass Python … Read more

How to Open Multiple Files in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to open multiple files in Python. 💬 Question: How would we write Python code to open multiple files? We can accomplish this task by one of the following options: Method 1: Open Multiple Text Files using open() Method 2:Open Multiple Text Files using open() … Read more

PEP 8 – When to Add Two Blank Lines in Python?

When to Use Two Blank Lines? PEP 8 Style Guide The following two rules will provide you a sufficient heuristic on when to use two blank lines: Surround top-level function and class definitions with two blank lines. Insert two blank lines after the import statements if the code that follows starts with a top-level function … Read more

How to Divide Each Element in a List in Python

Summary: The most Pythonic approach to divide each element in a list is to use the following list comprehension: [element/divisor for element in given_list]. Read ahead to discover numerous other solutions. Problem: How to divide each element in a list and return a resultant list containing the quotients? Example: li = [38, 57, 76, 95, … Read more

[FIXED] Carriage return Not Working with Print in VS Code

FIX: To fix the carriage return now working issue in your IDE, you must directly use the terminal to execute the code instead of using the built-in output console provided by the IDE. Problem Formulation It is a common issue in many IDEs, including VS Code and PyCharm, wherein the carriage return character (‘\r’) does … Read more

Normal Distribution and Shapiro-Wilk Test in Python

Normal distribution is a statistical prerequisite for parametric tests like Pearson’s correlation, t-tests, and regression. Testing for normal distribution can be done visually with sns.displot(x, kde=true). The Shapiro-Wilk test for normality can be done quickest with pingouin‘s pg.normality(x). 💡 Note: Several publications note that normal distribution is the least important prerequisite for parametric tests and … Read more

Pearson Correlation in Python

A good solution to calculate Pearson’s r and the p-value, to report the significance of the correlation, in Python is scipy.stats.pearsonr(x, y). A nice overview of the results delivers pingouin’s pg.corr(x, y).  What is Pearson’s “r” Measure? A statistical correlation with Pearson’s r measures the linear relationship between two numerical variables. The correlation coefficient r … Read more