1,954 reputation
532
bio website
location
age
visits member for 2 years, 10 months
seen 5 hours ago

Dec
5
comment How to exclude the diagonal in a MatrixPlot?
@SimonWoods I just want the diagonal to be drawn white, independently of the color gradient used, and the gradient should not depend on the values at the diagonal.
Dec
5
comment How to exclude the diagonal in a MatrixPlot?
@Öskå The range of your non-diagonal elements includes 0. Hence the gradient doesn't change appreciably. My non-diagonal elements have different ranges.
Dec
5
asked FindGraphCommunities method options?
Dec
5
asked Split graph into independent maximal cliques?
Dec
5
comment What does the VertexMoving method for FindGraphCommunities do?
What is this method? FindGraphCommunities[g,Method->"VertexMoving"] doesn't do anything....
Dec
5
asked How to exclude the diagonal in a MatrixPlot?
Dec
4
accepted Community detection on weighted graphs?
Dec
4
comment Insert at specific resulting positions in multidimensional list?
That doesn't work as I want. The position of y in {{1}, {2, x, 3, y, 4}, {3, 4}, {5, z}} is {2,4}, but I want it to be {2,3}. The output I expect from inserttt[{{1}, {2, 3, 4}, {3, 4}, {5}}, {x, y, z}, {{2, 2}, {2, 3}, {4, 2}}] is {{1},{2,x,y,3,4},{3,4},{5,z}}
Dec
4
comment Insert at specific resulting positions?
@DavidG.Stork Yes. As I explain in the answer, this method doesn't allow inserting multiple elements. It only inserts copies of the same element. Hence I obtain {x, 1, 2, 3, x, 4, 5}
Dec
4
comment Insert at specific resulting positions in multidimensional list?
@Kuba Typo. Fixed.
Dec
4
revised Insert at specific resulting positions in multidimensional list?
added 8 characters in body
Dec
4
comment Insert at specific resulting positions?
Sorry about that. I had a typo.
Dec
4
asked Insert at specific resulting positions in multidimensional list?
Dec
4
revised Insert at specific resulting positions?
added 30 characters in body
Dec
4
comment Insert at specific resulting positions?
@andre Thanks for pointing out that the positions list should be sorted ;)
Dec
4
comment Insert at specific resulting positions?
I think that insertF = Fold[Insert[#, #2[[1]], #2[[2]]] &, #, SortBy[Transpose[{#2, #3}], Last]] &; works.
Dec
4
comment Insert at specific resulting positions?
In think the Accumulate@#3 is the problem. Replacing it with just #3 works.
Dec
4
comment Insert at specific resulting positions?
The line of code Fold[Insert[#, #2[[1]], #2[[2]]] &, list0, {{a, 1}, {x,5}}] gives what I want. However the function insertF as you defined it doesn't. In your example with the function, x should be inserted at position 4 of the resulting list.
Dec
4
comment Insert at specific resulting positions?
@andre myInsert[list0,{a,x},{4,1}] should output {x,1,2,a,3,4,5}. The list of positions {4,1} gives the positions of the inserted elements in the resulting list.
Dec
4
comment Insert at specific resulting positions?
@DavidG.Stork I disagree. This produces the desired output (I am the OP ;)). Please tell me why you think this is not consistent with what I asked.