Avoid warnings using List.Map vs Function Apply

looks like List.Map produced correct result but Function Apply didn’t, anyone know what i did wrong, thanks in advance!

Try removing the list level from the function.

thanks JacobSmall, same result

Next thing to try: wrap your list in another level with a List.Create node.

As you’ve noticed, Functions do not pass on list levels. The reason List.Map works is because it’s specifically intended for lists (of lists) which just happens to match the structure and list level of what you’re after. Whereas Function.Apply just iterates normally, treating the input argument as a singular list (because it is) and not replicating its functionality over the sublists.

The point here is to use list levels instead of either one.

thanks Nick for the insight, so to avoid warning in list processing, better to use List.Map, above all, best to use Python.

No - Python is just as likely to have issues if you don’t handle errors or manage your data. In fact Python can partially work, fail, and then stop processing so you don’t know what data still has to be processed and what is good to go.

Above all, best to structure the data, handle errors, and review results.

1 Like

To add to what Jacob said, the real power of using nodes over function mapping or python is the inherent iteration of lists. With a defined structure, you don’t have to worry about lists or lengths or too many other variables. As long as you understand how a node handles a given list structure and provide the proper list levels it will work.

1 Like

agree, i noticed that nodes w/ or w/o levels are (only) for unified list structure, at first, i thought i can write Python for all cases and avoid warnings, thanks both for your insight.