Code snippets of tricks in data transformations in python