I have the following sample list (my actual list is, of course, much longer):
A={{{"15", "CG"}, {"391", "CG"}, {"412", "CC3"}}, {{"3", "CG"},
{"16", "CG"}, {"392", "CG"}}};
I would like to map an arbitrary function f
onto the string representation of numbers, like this:
{{{f["15"], "CG"}, {f["391"], "CG"}, {f["412"], "CC3"}}, {{f["3"], "CG"},
{f["16"], "CG"}, {f["392"], "CG"}}}
Is there a straightforward, succinct way of doing this using Map
, MapAt
, or something else? Unlike Map
, it seems that MapAt
does not have an option with levelspec.