Best 15+ Machine Learning Cheat Sheets to Pin to Your Toilet Wall

Toilet Wall Cheat Sheet

This article compiles for you the 15 best cheat sheets in the web that help you get started with machine learning. If you’re short on time, here are the 15 direct PDF links (open in a new tab): Supervised Learning (Afshine Amidi) Unsupervised Learning (Afshine Amidi) Deep Learning (Afshine Amidi) Machine Learning Tips and Tricks … Read more

They Use These 15+ Python Interview Questions To Fail You … (And What You Can Do About It)

Fear Your Coding Interview? This article shows you how to make your coding interview a success. General Tips to Prepare Your Interview Watch Google Interview tips. Read Prof. Philip Guo’s tips. Practice coding in Google Docs. Don’t use a code highlighting editor for your training time. Solve at least 50+ code puzzles. And most importantly: … Read more

How to Become a Python Freelancer—and Earn $1,000 on the Side? [A Step-by-Step Tutorial]

Pyhton Freelancer

Do you want to earn money as a Python freelancer? But you just start out learning Python? This article leads you step-by-step through the adventure of becoming a Python freelancer. Learn about the exact steps you need to do to become a Python freelancer – starting out as a Python newbie. Without losing any time, let’s dive into the 7 steps of becoming a Python freelancer.

How to List All Files ONLY in the Current Directory?

Problem Formulation How to list all files in the current directory given these constraints: Non-Recursive: You do not want to list files in subdirectories. ONLY Files: You do not want to list folder names. Current Directory: You run the Python script from the current directory. Here’s an example structure: current_folder — code.py — file.txt — … Read more

Pandas DataFrame Methods: nlargest(), nsmallest(), swap_level(), stack(), unstack() and swap_axes()

The Pandas DataFrame/Series has several methods to re-shape, sort, and transpose the data. When applied to a DataFrame/Series, these methods evaluate and modify the data to accommodate the selections. This is Part 14 of the DataFrame methods series: Part 1 focuses on the DataFrame methods abs(), all(), any(), clip(), corr(), and corrwith(). Part 2 focuses … Read more

How to Make a Beep Sound in Python? [Linux/macOS/Win]

Windows: How to Make Beep in Python To make a beep sound in Python on your Windows machine: Import the library using: import winsound Call windsound.Beep(frequency, duration) for your desired frequency (in Hertz) and duration (in milliseconds). For example, winsound.Beep(2000, 1500) would make a sound with 2000 Hz for 1.5 seconds. Here’s the relevant code … Read more

How to Remove a Trailing Newline?

Use str.rstrip() to remove a trailing newline. Given a string s, create a new one without trailing newline character by calling s.rstrip(‘\n’). If you need the string stored in the original variable, simply assign the result to the original variable. Here’s an example: This actually removes all trailing newline characters: If you want to remove … Read more

Pandas DataFrame Methods: drop_level(), pivot(), pivot_table(), reorder_levels(), sort_values() and sort_index()

The Pandas DataFrame/Series has several methods to handle Missing Data. When applied to a DataFrame/Series, these methods evaluate and modify the missing elements. This is Part 13 of the DataFrame methods series: Part 1 focuses on the DataFrame methods abs(), all(), any(), clip(), corr(), and corrwith(). Part 2 focuses on the DataFrame methods count(), cov(), … Read more

Python __aiter__() and __anext__() Magic Methods

object.__aiter__(self) object.__anext__(self) 💡 Summary: Python’s __aiter__() and __anext__() methods are used to implement an asynchronous for loop (keywords: async for). In contrast to a normal (synchronous) for loop, an asynchronous for loop iterates over an asynchronous source. __aiter__() returns an asynchronous iterator object (in many cases it’s simply a reference to itself: return self) __anext__() … Read more

Pandas DataFrame Missing Data Handling – isna(), isnull(), notna(), notnull(), pad() and replace()

The Pandas DataFrame/Series has several methods to handle Missing Data. When applied to a DataFrame/Series, these methods evaluate and modify the missing elements. This is Part 12 of the DataFrame methods series: Part 1 focuses on the DataFrame methods abs(), all(), any(), clip(), corr(), and corrwith(). Part 2 focuses on the DataFrame methods count(), cov(), … Read more

Python __aexit__() Magic Method

object.__aexit__(self, exc_type, exc_val, exc_tb) 💡 Summary: Python’s __aexit__() magic method is semantically similar to __exit__() but is used for asynchronous and parallel programming. Python calls the __aexit__() magic method when leaving an async with block whereas the __aenter__() method is called when entering it. An object that implements both __aenter__() and __aexit__() methods is called … Read more