Image Resizing and Cropping Tool in Python

How do websites make those icons scale up and down with your screen size? By having multiple of the same image in different sizes. If you want to add your logo to your site in multiple different sizes, then you’ll need to learn how to do image resizing. Image resizing is always an annoying task.Continue reading “Image Resizing and Cropping Tool in Python”

A Complete Guide to Python String Manipulation

I am pretty sure I’ve had to look up how to work with strings over 100,000 times now. Not just in Python, but for programming in general. Strings are not treated the same in each programming language though. For example, you have to use pointers to mess with strings in C. However, Python provides aContinue reading “A Complete Guide to Python String Manipulation”

Super Simple Python: Reading and Writing to a Text File

Reading and writing to a text file are two of the most basic ways to import and export data with Python. In 2022, Python is strongly known for machine learning use cases. While text files are not traditionally thought of as ML data containers, they can often be the medium of inference. For example, IContinue reading “Super Simple Python: Reading and Writing to a Text File”

Dijkstra’s Algorithm in 5 Steps with Python

Dijkstra’s Algorithm is one of the most well-known graph algorithms. It is also one of the hardest to spell and pronounce. It’s pronounced “dike-struh” algorithm. Dijkstra’s algorithm is a shortest path algorithm with many variations. In this post we’ll be going over two Python implementations of Dijkstra’s algorithm. ‘ The first is the naive implementation,Continue reading “Dijkstra’s Algorithm in 5 Steps with Python”

295. Find Median from Data Stream LeetCode Solution

I don’t usually do LeetCode problems, but this one comes up as a real life use case for me so I wanted to share. This problem is about data streaming and handling data in real time. It’s similar to what we call ETL or ELT in industry. LeetCode 295. Find Median from Data Stream ProblemContinue reading “295. Find Median from Data Stream LeetCode Solution”

Super Simple Python: Simple Calculator

Super Simple Python is a series of Python projects you can do in under 15 minutes. In this episode, we’ll be covering how to build a simple calculator in under 30 lines of Python! For a video version: Unlike some of the Super Simple Python examples we’ve done, these don’t require any libraries!  Defining theContinue reading “Super Simple Python: Simple Calculator”

Prim’s Algorithm in Python for MST

Minimum Spanning Tree (MST) algorithms find the shortest path that connects all the points in a graph. Tree algorithms that find minimum spanning trees are useful in network design, taxonomies, or cluster analysis. On PythonAlgos, we’ve already covered one MST algorithm, Kruskal’s algorithm. This time we’re going to cover Prim’s algorithm for an MST. Prim’sContinue reading “Prim’s Algorithm in Python for MST”

Level 1 Python: Scientific Calculator

As part of the Super Simple Python series, we made a basic, four-function calculator. Since then, we’ve also covered how to do math in Python. From the math tutorial, we learned how we could use the Python math module to perform operations outside of the basic add, subtract, divide, and multiply.  Let’s use the mathContinue reading “Level 1 Python: Scientific Calculator”

Python Generators, Yield, and Yield From

Introduced in PEP 255, Generators are a special type of Python function that return lazy iterators. Python yield‘s generators. A lazy iterator is one that does not hold its contents in memory. This is especially useful when dealing with large amounts of data and for optimizing space complexity. They’re also useful for animations, as weContinue reading “Python Generators, Yield, and Yield From”

Create Your Own AI Content Moderator – Part 3

As content on the web increases, content moderation becomes more and more important to protect sensitive groups such as children and people who have suffered from trauma. We’re going to learn how to create your own AI content moderator using Python, Selenium, Beautiful Soup 4, and The Text API. Our AI content moderator will beContinue reading “Create Your Own AI Content Moderator – Part 3”

%d bloggers like this: