Long-to-wide

Modified on Mon, 19 Dec, 2022 at 6:18 PM

Description

This manipulator transforms a long table into a wide table.


Application

Engineering data is recorded in various different ways, whether it comes from a test bench, sensors or even simulations. To use this data to explore results and train models, you will need a consistent format. In some occasions, it means changing the shape of the table to make it easier for a model to learn from it. To learn more about long and wide tables see our article What is a "long" and a "wide" table?

This function is also useful if you work with curve data and want to train a model on an entire curve to enable curve optimisation. In this case you need the entire data of a curve as one data point which is the wide format.


How to use

You start with a long table like this example:

You need to fill the four fields of the manipulator:

Data
The dataset to transform from long to wide.
ID
The column which is identifying the test to which a data point belongs. In our example above that would be column ID.
Column
To this field you assign the column with the series variable like time, frequency, engine speed, or crank angle. In our example above we assign column Time.
Values
To this field you assign the column with the values of the series data like pressure, temperature, strain (in general some sensor signal). In our example above we would assign the Value column to this field.

The resulting wide table for the example above would look like this:

Each test is now compressed into a single line with one column for each row of the former Value column. The header for these columns is the label of the previous Value column with the connected time value. The information that gets lost here is the fact that the number in the column header is the time and its dimensions.


More on this step

If you need to do the conversion the other way round you can use the Wide-to-Long function.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article