O'Reilly logo

Using OpenRefine by Max De Wilde, Ruben Verborgh

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

Recipe 7 – transposing rows and columns

Sometimes data is not arranged into rows and columns the way you like. Indeed, there are different ways of arranging what belongs where, and the choices depend on the situation. In the Powerhouse Museum dataset, for instance, there are separate columns for several dimensions: Height, Width, Depth, Diameter, and Weight. However, not many objects have data for these columns, so the cost of maintaining them might be high with respect to the value they add. An alternative would be to transform these five columns into two columns: one that contains the name of the dimension (for instance, Height or Weight) and another that contains the measurement (for instance, 35mm or 2kg).

What we want to do here is to transpose ...

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