Update data science solution

Find a way to refactor these `do/end` blocks so that they're on one line. Doing it this way makes it hard to read.