Hi All,
I have a dataset something similar to following
Name Location Nickname saleCost rest1 east Reast1 [5, 7, 9 , 2, 5, 1, 9, 11, 1] rest4 south Rsouth4 [12, 9, 2, 3, 5, 10, 11, 4, 4] rest3 east Reast3 [20, 2, 2, 3, 20, 30, 1, 3, 7] rest9 west Rwest9 [1, 9, 3, 33, 22, 10, 6, 6, 8]
Note that saleCost is a dataset as well and as number of columns which are multiple of 3.
I want to add up every 3 columns so my resultant dataset is as follow
Name Location Nickname saleCost rest1 east Reast1 [21, 8, 21] rest4 south Rsouth4 [23, 17, 19] rest3 east Reast3 [24, 53, 11] rest9 west Rwest9 [13, 65, 20]
I tried using reshape() but could not use it correctly. WHat are my options?
Thanks
Best Answer