Skip to content

Instantly share code, notes, and snippets.

View iwanbolzern's full-sized avatar

Iwan Bolzern iwanbolzern

View GitHub Profile
@iwanbolzern
iwanbolzern / multi_feature_done_callback.py
Created January 22, 2020 07:17
Simple code snipped for adding a done callback to multiple features ✨
def multi_feature_done_callback(futures: List[Future], final_cb: Callable):
head = futures.pop(0)
if len(futures) <= 0:
head.add_done_callback(lambda future: final_cb())
return
head.add_done_callback(lambda _: self._wait_future_async(futures, final_cb))
@iwanbolzern
iwanbolzern / readme.md
Last active March 14, 2022 11:12
Have you ever been in a situation where you would have liked others to give you a data frame with the right columns? If no, you're a lucky one. 🤩 If yes, check out this gist 🧐

First step in the direction of a really typed DataFrame

I come across many great libraries every day, but unfortunately most of them are not well suited for enterprise or medical projects, because they lack the possibility for proper interface definitions or the ussage of refactoring capabilities of your IDE.

This is especially true if it comes to libraries in the data science area. Just remember your last df['my_feature'] = df['my_feature'] * 2 😉 And unfortunately, exactly these libraries are also the ones that are written for super fast computations.

Well it seems that we have the choice between the super fast not typed option and a bunch of slow crappy other implementations...

Hard life... 😥

@iwanbolzern
iwanbolzern / README.md
Created November 7, 2025 21:12
This notebook serves as a calculator and visual guide for a crucial financial decision that married couples in Switzerland face upon retirement: choosing the level of the survivor's pension (widow's/widower's pension) from the occupational pension fund (2nd pillar, PKG).

Pension Fund (PKG) Options Calculator (Switzerland)

This notebook serves as a calculator and visual guide for a crucial financial decision that married couples in Switzerland face upon retirement: choosing the level of the survivor's pension (widow's/widower's pension) from the occupational pension fund (2nd pillar, PKG).

The Financial Context (Research)

In Switzerland, the level of the widow's or widower's pension from the pension fund (PKG) is regulated by law. The minimum legal requirement (BVG/LPP compulsory benefits) states that the surviving spouse receives a pension equivalent to 60% of the deceased partner's retirement pension.

However, many pension funds offer flexible models (in the non-compulsory/extra-mandatory part). Insured individuals can voluntarily choose to reduce their own retirement pension. In return, the future survivor's pension for their spouse is increased, for example, to 80% or 100% of the (now reduced) retirement pension.