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 →

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 →

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 →