Imagine you are a code translator. Your task is to convert the following R code to Python. [Insert code]