Category: Python

Python code examples

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: , , , , ,

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 – Solving 7 Queen Problem with Tabu Search

The n-queens problem is a classic puzzle that involves placing n chess queens on an n × n chessboard in such a way that no two queens threaten each other. In other words, no two queens should share the same

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: , , ,

Trigonometric Functions – Sine

The sine function is one of the most fundamental concepts in mathematics, connecting geometry, trigonometry, and real-world applications. In its simplest form, sine is defined in a right triangle as the ratio of the length of the side opposite an

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: , , , , , ,

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: , , , ,

Python – Central Limit Theorem

Here is an explanation of the Central Limit Theorem (CLT) in a few simple points: Explanation: The Central Limit Theorem states that the distribution of the sample means (averages) of a large number of samples from any population will be

Tagged with: , , , , ,

Object Oriented Programming with Python – YouTube video

Object oriented programming (OOP) in general is a huge topic, but I have decided to make a 30 minute video, based on the book Math for Programmers, as I liked the way it was explained there: Generally, in the video,

Tagged with: , , , , , , , ,

Linear Algebra – Drawing with Vectors – 3d and 2d

Plotting 2d and 3d vectors into a 3d space can be actually fun. Using mainly the code from Math for Programmers, I am presenting in this video an example of plotting 2d into 3d and back, using identity matrix and

Tagged with: , , , ,

Simplifying Excel Tasks with Python: Data Handling and Testing Tutorial

Working with Python and Excel is actually quite handy, especially if you are into it. In this article, you can see how to create Excel files, write data and formulas into them and read these. Pretty much simple CRUD methods.

Tagged with: , , , , , , ,

Python API With Flask And Postman – Put and Delete Methods

In the previous article, the post and get API methods were presented. In this one, Put and Delete are coming. 🙂 Well, nothing that fancy, this is how these two methods look like:

And, of course tests are a

Tagged with: , , , , ,

Python API With Flask And Postman – Post and Get Methods

This is the second video for the “Python API with Flask” series, showing how to make POST and GET commands towards a dummy database, which is a python list in our case. We are using only CREATE and READ commands

Tagged with: , , , , , , ,
Top