Subtracting from a specific column
You could use: MapAt
:
MapAt[ # - 1 &, list, {All, 1}]
{{-1 + a, b, c, d}, {-1 + e, f, g, h}, {-1 + i, j, k, l}}
or Apply
at the first level (shorthand @@@
) (see also SlotSequence
, shorthand ##n
):
{#1 - 1, ##2}& @@@ list
This is quite neat:
list[[;; , 1]]--
If you write
list[[All, 1]] = list[[All, 1]] - 1
list
will be updated with the new values of the first element of each sublist.