# Tag Info

1 vote

### Finding and Plotting Minima

You can use ComplexExpand to get rid Abs and so forth, if z, ...
• 3,570

### How to apply Length in all elements

Using Cases: Cases[{1, {2, 3}, {4, 5, 6}}, x_ :> ReplaceAll[0 -> 1]@Length@x] ...
• 27.6k

### How to apply Length in all elements

list = {1, {2, 3}, {4, 5, 6}}; Using Max Max[1, #] & @* Length /@ list {1, 2, 3} ...
• 81.2k
Accepted

### How can I sort all levels except the innermost level?

Use Map[ f, expr, level spec] ...
• 1,460

### How can I sort all levels except the innermost level?

l1 = {{{d, c}, {b, a}}, {{4, 3}, {2, 1}}}; l2 = {{{{d, c}, {b, a}}, {{4, 3}, {2, 1}}}, {{{d, c}, {b, a}}, {{4, 3}, {2, 1}}}}; Using ...
• 27.6k
Accepted

### How to optimize performance with DeleteDuplicates?

In checking duplicates, you are considering 2, 4, 6, 8, 10 are the same as 1, 3 ,5, 7, 9, respectively. Then, instead of testing all possible replacement, I recommend you to convert into standard ...
• 1,460
1 vote

### How to exclude singularities for NMinimize

If we take objective from @user64494 answer, we first check the region where objective \[Element] Reals ...
• 54.9k
1 vote

### Selecting only the quartic terms from an expression

A classic way is to scale each variable by a dummy variable, say, k. Then the coefficient of k^n consists of all the degree <...
• 239k
1 vote
Accepted

...
• 160k

### How to exclude singularities for NMinimize

The following works without any errors and warnings in 14.0 on Windows 10. We use exact numbers to avoid problems with the evaluation. ...
• 27.3k

This is the code from the article you provided in your question: https://arxiv.org/pdf/0804.2239 ...
• 2,444
1 vote

### Slope of a line

data = {{x1, y1}, {x2, y2}}; A variant of Bob Hanlon's slope3 using ReverseApplied (new in ...
• 81.2k
1 vote

...
• 62.8k

...
• 27.6k

...
• 81.2k

### How can I permute pair of elements in a list?

Just for somethinng different: ...
• 62.8k

An attempt ...
• 20.8k
Accepted

...
• 1,460

### How can I permute pair of elements in a list?

res = MapAt[Reverse, {All, 2 ;; -1}] @ (Transpose[{Cases[list, _Symbol], #}] & /@ Permutations[Cases[list, {__}]]); Join @@@ res // Column
• 81.2k