I have column names in list within list with different size like [["a","b","c"],["d","e"],["f"]] also few of the columns contains NaN.
|a b c d e f|
|1 2 3 4 5 6|
|1 2 3 Nan NaN 6|
|1 2 3 4 inf 6|
The result should be the sum of a list within a list like g=a+b+c, h=d+e, i=f which are column names. NaN sum should result NaN, not 0. How to do that in a loop?
Expected Output
|g h i|
|6 9 6|
|6 NaN 6|
|6 inf 6|