I just discovered a nice way to create intermediary columns in a list, and I would like to know if I can have some problem with it. It Works like this:
Imagine I have this list, 5x3:
SeedRandom[0]
list=RandomInteger[100,{5,3}]
Now I want to add a new blank column after position 1. I can use 0 for that, as you can see:
list=list[[All,{1,0,2,3}]]
list[[All,2]]=100
list
{{83, 100, 66, 4}, {21, 100, 71, 67}, {16, 100, 67, 76}, {28, 100, 21, 43}, {17, 100, 46, 53}}
Using 0
put List as start element of the new column.
Question: Can I have some problem in doing that way? I can't see any. And it appears to work in a nice speed.
SeedRandom[0]; list = RandomInteger[100, {5, 3}]; list = Transpose@Insert[Transpose[list], list[[All, 2]], 2]
$\endgroup$