Preprocessing Data Using a Lambda Function