O'Reilly logo

Effective Amazon Machine Learning by Alexis Perrier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extracting the title from the name

If you look closely at the passenger names, you will notice that they are all in the {family name}{title}{first names} format. It would be interesting to extract the title as a new variable. The following query uses the split function, which returns an array. We need the second element of that array:

SELECT name, split(name, ' ')[2] as title from titanic;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required