period change in python