Using All in MapAt in Mathematica

前端 未结 5 1589
时光取名叫无心
时光取名叫无心 2021-02-20 02:28

I often have a list of pairs, as

data = {{0,0.0},{1,12.4},{2,14.6},{3,25.1}}

and I want to do something, for instance Rescale, to al

5条回答
  •  无人及你
    2021-02-20 03:22

    This worked for me and a friend

    In[128]:= m = {{x, sss, x}, {y, sss, y}}
    Out[128]= {{2, sss, 2}, {y, sss, y}}
    
    In[129]:= function[ins1_] := ToUpperCase[ins1];
    fatmap[ins2_] := MapAt[function, ins2, 2];
    
    In[131]:= Map[fatmap, m]
    Out[131]= {{2, ToUpperCase[sss], 2}, {y, ToUpperCase[sss], y}}
    

提交回复
热议问题