pandas has a .pipe operator which works exactly like this