Have you seen the error below? Traceback (most recent call last): File “C:/Users/foo/PycharmProjects/pythonProject3/main.py”, line 29, in <module> main() File “C:/Users/foo/PycharmProjects/pythonProject3/main.py”, line 19, in main a[‘foo’] += 5 KeyError: ‘foo’ Of course you have. And you know, that it is because …

Python – DefaultDict Object. Or how to avoid the Key Error. Read more »

Intersection of dictionary (or of any two lists) is a list with elements, that are present in both other lists. Thus, if we have the following 3 dictionaries in Python: dict_a = dict([(‘aa’, 4139), (‘bb’, 4127), (‘cc’, 4098)]) dict_b = …

VBA and Python – Intersection of dictionaries Read more »

The idea of the article is to show how to make a simple Django App, with 4 links, each of which navigates to a specific page. The whole code of the “app” is in GitHub, here: https://github.com/Vitosh/Python_personal/tree/master/JustProject. In general, these are …

Django – Making a simple web app with 4 links Read more »

In the previous article for abstraction and inheritance I wrote some classes, showing the basics of these two programming concepts. In this one, I will write unit tests for one of the classes, written before. Software testing is an important …

Python – Writing Unit Tests with unittest library – Video Read more »

Abstract class and abstract methods are one of the pillars of Object Oriented Programming. In Python, an abstract class is a class, inheriting from Abstract Base Classes (ABC) library. And an abstract method is a method of this class, which …

Python – Abstract Methods and Abstract Class – Live Coding Video Read more »

Long time ago, various people, including me, were trying to make permutations and combinations with nested loops and various other “heavy” structures. Anyway, in Python there is a library, which does this for us and sets the end of the …

Python – Permutations and Combinations Made Easy with Itertools Read more »

Today I have decided to check whether I can pass the first homework from SoftUni OOP with Python, through a live coding session. I have not read the problem before the video, thus I may say it took me exactly …

Python – Defining Classes and Methods with Python – LiveCoding Video Read more »

The Bayes’ theorem is interesting, as far as it is both quite challenging to understand and shocking once you really realize the simplicity of the numbers behind it. It describes the probability of an event, based on prior knowledge of conditions that …

Python – Bayes’ theorem – Drug testing example. 99% is not enough! Read more »

Working with python, pandas and dataframes is quite challenging even for experienced Excel & VBA developer, as I love to consider myself for one. Thus, today I was fighting for quite some time to add new columns to a dataframe, …

Python – Building New Columns in a Dataframe, Based on Other Columns Read more »