Tag: Python

Python – A Beam Search in Graph

In our previous article, we explored the A* (A-Star) Algorithm. It is the gold standard for pathfinding as it is optimal – it always finds the shortest path. But in the real world (chess engines, LLM) it might be too

Tagged with: , , , , ,

Python – A Star Search in Graph

A* is probably my favourite graph search algorithm. Some 10+ years ago, I have implmented it with Excel and after that I have written a few more implementations. Just, not to repeat myself, I will not discuss it here. The reason

Tagged with: , , , , ,

Dijkstra’s Graph Algorithm with Python

In the previous articles, we have presented graphs with BFS and DFS. The BFS is actually good to find the path with the fewest nodes. But if the path with the fewest nodes is actually the most expensive, then we

Tagged with: , , , ,

Depth-First Search (DFS) algorithm with Python

Yesterday (blogging every day now!) I have presented a visualization with Python, in which a simple and basic graph was displayed. Today, I have showed how to traverse it with DFS (Depth-First Search) with quite basic skills. Just for the

Tagged with: , , ,

Drawing a Graph with Python

Long time ago (somewhere in 2015) I have written an article about Dijkstra and the shortest path. In that article, I draw a graph on a notebook, just to illustrate what I was trying to traverse: Today, I was thinking

Tagged with: , , , ,

Python – The Minimax Algorithm: Achieving Perfect Strategy

The Minimax algorithm is a fundamental decision-making rule used in Artificial Intelligence (AI) for two-player, zero-sum games, such as Chess, Checkers, and, in our case, Tic-Tac-Toe. It works by exploring every possible future state of the game to find the

Tagged with: , ,

Python – Sliding Tile Puzzle – DFS + IDA*

Sliding tile puzzle is something that is actually easy, if you are a fan of the Rubic Cube. And if you want to solve it with IDA* (iterative Deepening A*) and with Manhattan heuristic, this is the correct place. The

Tagged with: , , , , ,

Frog Leap Puzzle with Depth-First Search (DFS)

TL;DR: We solve the classic “frog leap” puzzle with Depth-First Search (DFS) by generating next boards around teh blank and trying jumps before steps. This trick finds the minimal soluton in exactly N^2+2N moves. The classic frog puzzle looks like

Tagged with: , , , , ,

XGBoost for beginners – from CSV to Trustworthy Model

This is what we do with in the YouTube video below: take a tiny CSV and explore it with plain words we train a strong model, using the XGBoost python library (eXtreme Gradient Boosting) pick a practical decision treshold and

Tagged with: , , ,

Correlation – explained with Python

When you plot two variables, you see data dots scattered across the plane. Their overall tilt and shape tell you how the variables move together. Correlation turns that visual impression into a single number you can report and compare. What

Tagged with: , , ,

Python – Learn Pandas with SQL Examples – Football Analytics Example

When working with data, you will often move between SQL databases and Pandas DataFrames. SQL is excellent for storing and retrieving data, while Pandas is ideal for analysis inside Python. In this article, we show how both can be used

Tagged with: , , , , ,

Docker Basics in Excel with VBA | Full CRUD Demo

After building a minimal FastAPI + SQLite CRUD application in Docker, I wanted to show how Excel can connect directly to it. With a few lines of VBA, we can turn Excel into a client that talks to the API.

Tagged with: , , , , ,

Docker + Python CRUD API + Excel VBA – All for beginners

If you are just starting with Docker and want a practical project, here is a fun one: let’s build a tiny CRUD app in Python, run it inside a Docker container, and then connect to it from Excel with VBA.

Tagged with: , , , , ,

Exploring SOAP Web Services – From Browser Console to Python

SOAP (Simple Object Access Protocol) might sound intimidating (or funny) but it is actually a straightforward way for systems to exchange structured messages using XML. In this article, I am introducing SOAP through YouTube video, where it is explored through

Tagged with: , , , , ,

Shortest route between points in a city – with Python and OpenStreetMap

After the article for introduction to Graphs in Python, I have decided to put the graph theory into practice and start looking for the shortest points between points in a city. Parts of the code are inspired from the book

Tagged with: , , , , ,

Introduction to Graphs in Python

Lately, I am reading the book Optimization Algorithms by Alaa Khamis and the chapter 3 – Blind Search Algorithms, has caught my attention. The chapter starts with explaining what graphs are how these are displayed in python and I have

Tagged with: , , , , , ,

Python – Monte Carlo Simulation

Python can be used for various tasks. One of these is Monte Carlo simulation for future stock analysis. In the video below this is exactly what is happening. 🙂 Instead of explaining the video and its code (available also in

Tagged with: , , , ,

Python – Simple Stock Analysis with yfinance

Sometimes, the graphs of stocks are useful. Sometimes these are not. In general, do your own research, none of this is financial advice. And while doing that, if you want to analyze stocks with just a few lines of python,

Tagged with: , , , , , , , ,

Python – Reading Financial Data From Internet

Reading financial data from the internet is sometimes challenging. In this short article with two python snippets, I will show how to read it from Wikipedia and from and from API, delivering in JSON format: Reading the data from the

Tagged with: , , ,

Python – Data Wrangling with Excel and Pandas

Data wrangling with Excel and Pandas is actually quite useful tool in the belt of any Excel professional, financial professional, data analyst or a developer. Really, everyonecan benefit from the well defined libraries that ease people’s lifes. These are the

Tagged with: , , , , , , , , , ,

Automate Stock Analysis with Python and Yfinance: Generate Excel Reports

In this article, we will explore how to analyze stocks using Python and Excel. We will fetch historical data for three popular stocks—Realty Income (O), McDonald’s (MCD), and Johnson & Johnson (JNJ) — calculate returns, factor in dividends, and visualize

Tagged with: , , , , , ,

Sine and Cosine – A friendly guide to the unit circle

Welcome to the world of sine and cosine! These two functions are the backbone of trigonometry, and they’re much simpler than they seem. In this article, we will explore the unit circle, the home of sine and cosine, and learn

Tagged with: , , ,

Rule of 72

Ever heard of the Rule of 72? It’s a classic finance shortcut that tells you how many years it takes for an investment to double at a given interest rate—without reaching for a calculator! Pretty much, if you want to

Tagged with: , ,

Python – Stock Dashboard with Streamlit and YFinance

Imagine that you want to have all the important historical financial information of yahoo finance on your PC. Well, in that case you would probably go there and check it. Anyway, if you are a person, who wants to create

Tagged with: , , ,

Automated Stock Diagrams with Python

Automated stock diagrams with Python is actually a rather useful idea, if you want to see how your portfolio is distributed. Just by using 2 columnes – “Ticker” and “Shares” in a CSV file, you can obtain a lot of

Tagged with: , , , ,

From Pythagoras to Law of Cosines

The field of geometry offers tools that have withstood the test of time, empowering us to understand and solve a variety of triangular problems. Among these, the Pythagorean Theorem and the Law of Cosines are cornerstone concepts. This article provides

Tagged with: , , , , , ,

Solving Triangle Medians and Cevians with Python

If you remember some advanced math problems with triangles, where you have some cevians and medians, that split a triangle’s side into a 4:3 ration and you have to find the ratio of the split of the two cevian itself,

Tagged with: , , , ,

Python – Intersecting Line With Circle

Ever wondered how people can say with 100% security where a circle intersects a line? No? Me too, but still I have decided to try to show how this is done. With Python it looks like a piece of cake.

Tagged with: , , , , , ,

Python – Getting an Excel List of all Folders and Files in them

Getting a list of all folders within a given folder is actually a single line command. Writing it to Excel is usually another line. Getting all files, within these folders is not a lot as well. However, having a tool

Tagged with: , , , ,

Python – Simulating the Bitcoin Mining Process – YouTube video

Ok, currently the BTC is 68 491,28 USD and instead of feeling bad for not buying it, you can try to simulate it the mining process with Python just for fun. It is an interesting way to have fun, but

Tagged with: , , , ,
Top