Update transform.py

2 good suggestions from @btel - docstring added and a better method name