[python] Apply vs transform on a group object