All Questions
Tagged with built-in-symbols list-manipulation
24 questions
3
votes
1
answer
83
views
Basic question Sort criteria
Can you explain the following codes? (output of codes)
I know that
there is the default ordering for any expression in Mathematica
and Sort uses the default ...
0
votes
1
answer
127
views
How to convert a list of indexed variable names to a list of formal symbols?
I have the following list of indexed variable names:
list = {x1,x2,x3,x4};
I would like to build a list of formal symbols from the above list, i.e.
...
1
vote
1
answer
89
views
Why does my simple string function fail to grab the only element in a List?
The idea is to normalize a string before processing it to extract information from it. Strings may come with embedded outer brackets which are easily stripped or as elements of a true list. This is ...
0
votes
0
answers
70
views
Packed/Unpacked array - what object/like 0 or 1?/how to check/ [duplicate]
In Mathematica, there is a concept called packed array.
...
1
vote
2
answers
169
views
Two questions about `Infinity` [closed]
These are 2 small questions about Infinity. They are not related each other.
Q1)
...
7
votes
7
answers
704
views
Grouping consecutive elements at specified positions
Let
L1={1,2,4,6,8,9,10,14,15,17,21,22,72,76,80,96,106,116,117}
Question1) Group from 10-th to 14-th elements in L1.
So that the ...
4
votes
1
answer
134
views
Extracting list structure from nested list
Can we construct a function f, g in mathematica such that
For any list L,
g[Flatten[L],f[L]] ...
10
votes
4
answers
521
views
Construct a pure function containing built-in 'Sequence'
I guessed the output for
(Sequence[#, 7]&)[3]
should be
Sequence[3,7]
But my guess was wrong. See the screenshot:
And I ...
2
votes
1
answer
363
views
4
votes
1
answer
366
views
Largest k such that p^k divides n
(Here all variables are integer.)
Is there a built-in function f[n,p] such that
f[n,p] = largest k such that p^k divides n
For ...
7
votes
4
answers
452
views
AnyTrue is too good (compared to MemberQ)
Let L be a list of integers, and ⓝ denote an explicit integer.
I've thought the most natural way to tell whether ⓝ belongs to L is
In[1] MemberQ[L, ⓝ]
But there ...
3
votes
2
answers
153
views
Check an input matrix M contains any nonzero diagonal matrix element or not
Is there a way to easily check an input matrix M contains any nonzero diagonal matrix element or not?
For example,
if the M contains any nonzero diagonal matrix element, Output: True.
if the M ...
0
votes
0
answers
123
views
Find fit for 3D data
Consider some dataset in the form {x,y,data[x,y]}:
...
3
votes
1
answer
139
views
How to arrange two tables in the following way?
Consider two tables:
...
18
votes
1
answer
403
views
Head[x] vs x[[0]]
Can we say Head[x] and x[[0]] are identical ?
In mathematica manual I could find : 'The head is the part with index 0'
But I am not sure whether Head[x] are x[[0]] are really interchangeable in any ...
0
votes
0
answers
63
views
After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug
This question is related to this one in the sense that it uses the code from there.
What happens is best illustrated in the video here. When I run (* part 1 *) ...
1
vote
1
answer
148
views
JoinAcross with multiple associations
I would like to use JoinAcross to combine several lists of associations. Extending an example from the documentation, I'd like to do this:
...
8
votes
3
answers
580
views
Is there a built-in function to get the centroid of a table?
Suppose I have a table with some data that are 'lumped' around some central location, such as the dummy example
...
6
votes
2
answers
361
views
How to create non-rectangular array with Array?
From the answers to this question, I learned that the recommended way to construct a symbolic sum of terms in an expression is to use Array.
But I'm having a ...
7
votes
2
answers
235
views
Constructing expressions using Sum vs Array[... Plus] vs Plus@@Table[...]
For constructing a sum of terms which are symbolic, I noticed that in addition to
...
8
votes
3
answers
147
views
Is there a PartDelete like there is a TakeDrop
TakeDrop is nice because after taking a subarray, it also returns the remaining subarray. But it is limited in that the part specification can only be ranges, and ...
7
votes
8
answers
497
views
What is the inverse of the Position function?
What is the inverse of the Position?
I have an array which contains the positions of elements and I want a function which returns an List which contains 1 where ...
5
votes
4
answers
745
views
Mean of a list of lists (vector) with missing values
I understand, from Calculating the mean of a list with NaN values, that one can preserve structured data with missing values, and still calculate a mean, using ...
0
votes
0
answers
59
views
built-in functions with one argument
I want to find the (NumericFunction) built-in functions that take exactly one document.
...