LIst Column to Columns

I want to preface by saying that I am still learning KNIME and will be using it for the first time this semester in an MBA class. One of my lessons will be to show how to work with different types of datasets (i.e. text, images).

My question: In working through an example of this task, I have a step that flattens an image into a single list column. The length of the list is fixed and the same for each row. Instead of a list column, I want each entry in the list to be its own column. For example, instead of a list column that is of length 5, I want five separate columns, one for each value in the list.

I am looking for a list conversion node and can’t seem to pin down on a pathway to achieve the above task. Note: Using Neural networks is outside the scope of this class, so I am flattening the image, one pixel per column.

Ahhh, in my case, RTFM. I didn’t realize the list is a “collection”, and there is the Split Collection Column node.

:person_facepalming:

2 Likes

Was about to suggest - ungroup and then potentially table transposer ( not 100% sure if ungroup results in one column per item or one row per item of the list).

If you get one column with multiple rows table transpose flips it on the side!

2 Likes

Thanks for a prompt response! The KNIME AI suggested something similar, and while impossible (the pixel index is appended to the rowid), the Split Collection Column node does exactly what I need.

Not a complaint at all, quite the opposite, but holy moly KNIME has a ton of nodes! Still trying to pin down the lingo. I was looking for “list” operations before I actually read the Node docs and noticed the collection reference.

Can you send a demo here to understand the start and the result that you are wainting?

This is what did the trick for me.

  • Image to DataRow flattened each image to a feature vector, or a Collection which is represented as a single column in the dataset
  • Split Collection Column created a new column for each entry in the list. This is what I was asking for above.
1 Like