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. …
Python code examples
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. …
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 …
Python – Getting an Excel List of all Folders and Files in them Read more »
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 …
Python – Simulating the Bitcoin Mining Process – YouTube video Read more »
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 …
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, …
Object Oriented Programming with Python – YouTube video Read more »
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 …
Linear Algebra – Drawing with Vectors – 3d and 2d Read more »
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. …
Simplifying Excel Tasks with Python: Data Handling and Testing Tutorial Read more »
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: # Update item by id @app.route(‘/api/items/<int:item_id>’, methods=[‘PUT’]) …
Python API With Flask And Postman – Put and Delete Methods Read more »
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 …
Python API With Flask And Postman – Post and Get Methods Read more »
In the attached video below, I am simply showing the following 3 pieces of code with Jupyter Notebook: Remove spaces in dataframe columns. Remove none values from dataframe rows. Filter dataframes, based on values. E.g. – put all rows with …
Python – Remove spaces and None from pandas dataframe Read more »
Have you ever dreamt about coding classes like a pro? No? You had “normal” dreams? Anyway, in the video below, I am solving 3 exercises with a lot of debugging and some basic tests. Exercises are from the book Python …
Python OOP – Classes, Methods, Attribures, Composition, Inheritance Read more »
Finally! Microsoft did it! Put python in MS Excel! And I was able to install it and test it on my machine! The video of my attempts is here below: The “code” is that one: def factorial(a): print(a) if (a …
Python allows decent built-in logging. As I am going to explain in the video below, the built-in logging is actually rather neat – it allows everyone to log into a file or into the console within minutes – just the …
Python – Logging into a file and into the console Read more »
This is probably a python “feature” that every junior developer has bumped into – once you make an empty list as a default argument in Python, it works as expected only for the first object of the class. For the second object – not exactly. Don’t worry, everyone has hit that bug, even it they are not willing to admit it.
Another YouTube video for Python – this time, about reading and writing to files. It is a bit interesting, if these are your first steps with Python, for me it was a nice reminder of how the “things” used to …
Python – Reading and Writing Files – With YouTube Video Read more »
Creamer’s rule for a solution of linear equations states pretty much the following: Using this interesting picture from the German Wikipedia, I have created the following video, explaining a bit the Rule of Mr. Cramer: The video goes through the …
Python – Cramer’s Rule for Linear Equations – With YouTube Video Read more »
Same article, but for VBA is here – https://www.vitoshacademy.com/vba-split-worksheet-to-worksheets-save-excel-worksheets-to-csv/ This article does 2 things: Splits one worksheet to multiple worksheets Then goes through the worksheets and saves them as *.CSV files So what is the idea? Having this excel file, …
Python – Split worksheet to worksheets, save Excel worksheets to csv Read more »
Some time ago, probably yesterday or the day before, I had to filter a pandas dataframe and somehow it did not come intuitively into my mind how to do it. As I did not have an article about it, I …
Python – Filtering values from a Pandas DataFrame Read more »
Ok, dates in VBA and Excel are somehow complicated, because of some “feature” that Microsoft Excel has introduced, due to compatibility issues. I have already wrote a few articles about these here, and separate one about what day is Friday …
Python – Just a bit about datetime and timedelta Read more »
Sometimes, (but only sometimes) we think that writing too much code is useless and writing less code in python is more readable and performs faster. While in the general case this is true, this article is simply going to show …
Python – Init a class with a default list property correctly Read more »
Reading from the console and writing to it is a piece of cake in python. These two functions do it for you perfectly: a = input() print(a) Then why am I writing a whole article about it? Well, there is …
Plenty of times, when you are looping with a for-each loop in python, you somehow realize that you need a counter. Then you most probably write something ugly like this one: a = 0 for count_value in my_odd_squares: a = …
The idea of the article is to provide a Python code that does the following: Takes a list or DataFrame; Splits it into quite a few smaller parts; Writes each one on a separate Excel worksheet; Pretty much like this: …
Python – Write a DataFrame or List to multiple tabs in Excel Read more »
Plotting a circle with matplotlib library in python is an interesting task. If you google it, you will find quite good answers, but anyway, I am here because I want to summarize my point of view. Pretty much, the idea …
Dictionary to a CSV file is probably a good question, if you are hiring a VBA developer. For a python person it should be a trivial one, as this one should not be even a tough search in Google. Anyway, …
Getting some tiny URL, that redirects you to somewhere else might be dangerous. There are a lot of people, that would never ever click on bit.ly/something or goo.gl/something, just because they do not know where the redirect is going to …
How to get redirect url using Excel VBA or Python Read more »
Sometimes you need to do what you need to do – use Regular Expressions for a trivial task. Now, imagine that you have some big text and you need to extract all substrings from the text between two specific words …
Python – Find All Substrings Between Two Character Pairs with RegEx Read more »
Reading from a pdf is actually quite an easy task with Python. If the PDF is of course “readable”, e.g. made from a word processor. The first thing to do is to install Tika and Java: pip install tika conda …
After writing about Default Dictionary in Python some time ago, now it is time to take a look at the ordered dictionary and the heap queue as these are built-in structures, coming out of the box. And they are fancy. …