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

Python Regex Split Without Empty String

Problem Formulation Say, you use the re.split(pattern, string) function to split a string on all occurrences of a given pattern. If the pattern appears at the beginning or the end of the string, the resulting split list will contain empty strings. How to get rid of the empty strings automatically? Here’s an example: Note the … Read more

Python endswith() Tutorial – Can We Use Regular Expressions?

While refactoring my Python code, I thought of the following question. Can You Use a Regular Expression with the Python endswith() Method? The simple answer is no because if you can use a regex, you won’t even need endswith()! Instead, use the re.match(regex, string) function from the re module. For example, re.match(“^.*(coffee|cafe)$”, tweet) checks whether … Read more

Python next()

The next(iterator) function is one of Python’s built-in functions—so, you can use it without importing any library. It returns the next value from the iterator you pass as a required first argument. An optional second argument default returns the passed default value in case the iterator doesn’t provide a next value. Syntax: next(iterator, <default>) Arguments: … Read more

Python IDLE Syntax Highlighting

Python’s IDLE code editor comes with every standard Python installation in Windows, Linux, and macOS. You can use it right out of the box after installing Python on your computer. Related Article: How to Install Python? IDLE has a useful syntax highlighting feature that highlights different Python language features to help you grasp source code … Read more

Python Float Decimal to Octal

Problem Formulation: Given a float number. How to convert it to octal representation? Examples: Consider the following desired conversions from float decimal numbers to their converted float octal numbers. input: 3.14 output: 3.1075 input: 0.01 output: 0.005 input: 12.325 output: 14.246 You can play with some examples here: Solution: The following code function float_to_octal() takes … Read more