How to merge matching items in a list?

Hi All,

I am trying to make a script that will push our families in a warehouse project to excel.
I have a list for each placed family type, and its family, but some families have multiple types. Is there a way to filter or merge this so that the indices indicating the family will merge if matched, leaving a longer list of indices below for the types?
Example is current list has:
list 0
0- Fam A
1- Type A
List 1
0- Fam A
1- Type B.

I want it to look like:
0 Fam A
1 Type A
2 Type B


I have tried messing with different list creation methods, but list management seems to be an insurmountable peak for me for some reason. . .

Apologies if this has been answered, I couldn’t quite find what I was looking for searching the forums.

Hey,

Sorry, I don’t have time to build the solution, but if you grab the ‘family name’ and use ‘group by key’ i think it will work…

Hope that helps,

Mark

Thanks Mark, that wasn’t quite what I was aiming for, but its a step in the right direction! I’ll tinker with it until I get what I want unless anyone comes up with another idea.

Sorry, really snowed under today :frowning:

you’ll need to grab the family name directly before plugging into the group node i think? or maybe shunt the grouping back earlier?

I think we are on track here. I have a list of families, and a list of lists of the types in equal lengths.

I cant get the combine to work, but I’m getting there

I totally know what you mean. We have been busy too, hope you aren’t working too hard!

1 Like

try chopping the first list and then use the list.combine node with a list.join combinator :slight_smile:

Hi @GJax89

Another possible way to merge using python…

3 Likes

nice solution!