Python Int to Hex | String Formatting

πŸ’¬ Question: How to use Python’s string formatting capabilities – f-strings, percentage operator, format(), string.format() – to convert an integer to a hexadecimal string? Lowercase Solution without ‘0x’ Prefix You can convert an integer my_int to a simple lowercase hex string without ‘0x’ prefix by using any of the four string formatting variants—all based on … Read more

3 Best Ways to Generate a Random Number with a Fixed Amount of Digits in Python

Coding Challenge βš”οΈ Challenge: Given an integer d representing the number of digits. How to create a random number with d digits in Python? Here are three examples: my_random(2) generates 12 my_random(3) generates 389 my_random(10) generates 8943496710 I’ll discuss three interesting methods to accomplish this easily in Python—my personal favorite is Method 2! Shortest Solution … Read more

How to Randomly Sample from a Python List?

In data science, you will need to learn how to generate random numbers, which in Python, we can do with the random module. In this tutorial, you’ll learn how to solve the following programming challenge: βš”οΈ Challenge: How to do random sampling from a list in Python? Without further ado, let’s dive right into it! … Read more

Gradient Descent in Neural Nets – A Simple Guide to ANN Learning

πŸ’‘ Gradient Descent: What is it? Where does it come from? And what the heck is it doing in my ANN? You can scroll through the slides as you watch this video here: This article aims to present the gradient descent algorithm in a light fashion, familiarizing new Machine Learning enthusiasts with this fundamental technique… … Read more