platypus reduction in python