Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

learn more… | top users | synonyms (4)

1
vote
1answer
76 views

Looping through 3 million elements of a list to 'Set' values is slow

I am looping through the 3 million elements of a time-series (v1, o1) and corresponding values (v2, o2). v1 contains a uniformly increasing timestamp (e.g. 1 to 3,000,000 in increments of 1) o1 ...
-2
votes
1answer
40 views

How to sort my list? Help [on hold]

I have a list={1,2,3,4,5,-6,9,3,12,0,-3}. I want to sort its, as way {even,odd,even,odd,....}. Moreover in crescent way for even and odd numbers. So the result ...
2
votes
0answers
98 views

Brownian Bridge - Multiple Paths

I am attempting to simulate multiple Brownian Bridges on the interval [0, 1]. I have the following snippet: ...
3
votes
2answers
132 views

Modifying the content of a list

If I have a long list of form {{1,2,3,4},{5,6,7,8}, ... {97,98,99,100}} how do I edit/convert it by adding the text as shown below ...
5
votes
1answer
46 views

Generating repeated elements in a list [on hold]

Is there a function in mathematica that allows you to generate repeated elements inline within a list. For example, let's say you provided this as input text: {1, 2, 3, 4, Repeat[5,3], 6, 7} ...
0
votes
1answer
48 views

Avoiding misconversion of data with ToExpression function [on hold]

I've got a list of data with the following structure which can be easily converted To expresion by some manipulation such as ...
14
votes
3answers
443 views

How to zero (or replace) the diagonal of a square matrix?

Zeroing the diagonal of a square matrix is an operation I need frequently, but somehow I still haven't managed to find an elegant solution that satisfies all these requirements: works with both ...
13
votes
5answers
292 views

How to delete subsets quickly?

I have some data like this: ...
5
votes
3answers
174 views

Simple exercise using the function Cases

I'm having some trouble in the following exercise: Find which elements of the list are prime numbers or divisible by 3. list = Table[i^2 - 6 i - 1, {i, 0, 15}] ...
3
votes
4answers
140 views

Calculating expected value from paired values and weights

I'm very new to Mathematica. I just need a quick solution on how to multiply x with y when a data set is given as ...
2
votes
2answers
115 views

Combining lists to create points to plot with ListLinePlot [on hold]

I would like to make a ListLinePlot using these lists: ...
2
votes
4answers
82 views

Removing an ordered pair from a list of ordered pairs according to a certain criterion

I have a list of ordered pairs produced by evaluating {IsotopeData["Thorium226", "ExcitedStateEnergies"], IsotopeData["Thorium226", "ExcitedStateSpins"]} I'm ...
0
votes
0answers
60 views

Plotting 3D data as a surface [on hold]

I am having a problem plotting some data in a 3dimensional surface. These data are distributed like a surface. And I would like to plot them joining them all as a surface. The data are in the form ...
14
votes
8answers
365 views

Splitting a list into increasing sublists

I have a list of numbers (say, for example, {1,2,3,4,3,2,1,2,3,4,3,2}), and I want to split it into sublists so that each sublist is the (smallest) sublist whose ...
0
votes
0answers
46 views

Large lists to manipulate later in chunks [on hold]

If I try to evaluate either one of the following expressions: Table[n, {10^8, 10^9] Range[10^8, 10^9] I get ...
2
votes
2answers
71 views

Perform calculation on several sublists using Map

I am trying to perform a calculation on a list containing sublists. More exact: The x-axis values are time data, progressing from zero, the y-axis data are data points, which I want to normalize. I ...
0
votes
0answers
53 views

Piecewise NDSolveValue: Nested Variable Iteration

I am attempting to make the variable Rc a piecewise-function of [z] and have it update as NDsolve iterates through the range of 'z' such as {z,0,Le), but to no avail. The following code is an attempt ...
2
votes
3answers
160 views

Reassigning values in Map

I have a list of lists. Minimal example: lists = {{a,b,c},{d,e,f}} I want to set the values on position 2 (b and e) to the value of their right neighbour (c and ...
0
votes
0answers
74 views

Fitting Data using GeometricBrownianMotionProcess

I am trying to fit Data (see below) using a GeometricBrownianMotionProcess, and have attached two figures. One figure is that of the Data, and the other of the GeometricBrownianMotion for given ...
1
vote
2answers
38 views

Converting data set from one form to another

I wish to convert Data to Data2. Both sets are provided below. Note that the second set has an arbitrary parameter "t". How can this be done. ...
11
votes
5answers
312 views

Partition a list into sublists of different lengths

I have the list {a, b, c, d, e, f, g, h, i} and I want to make a sub-list of the form {{{a, b}, c}, {{d, e}, f}, {{g, h}, i}} ...
6
votes
2answers
240 views

Modifying the elements of a list according to a given probability

Let list be a list of lists, the elements of which are random integers in the interval $[1,c]$. Each element $i$ has a probability ...
6
votes
5answers
162 views

Nested list from a flat folder list

I have a list of folders and files in my current working directory as a result of a built-in function FileNames: FileNames["*", "", Infinity]]. It looks like this: ...
0
votes
3answers
54 views

How to generate a list of outputs for function f(x,y) for a set of known (x,y) values [closed]

Say I want a list of outputs the function f(x,y)=x+y will give for x,y values of (1,5),(5,3),(0,2),(1,1),(2,6). How do I do that? I know this must be pretty straight forward. I just can't figure it ...
0
votes
1answer
29 views

Using Select function to select elements based on last element of nested list [closed]

Good morning, I have a list with each element containing a tuple and a single. It is of this form: ...
9
votes
1answer
85 views

How to partition a 2-D array properly?

Given that I have the following array lst = Array[Subscript[P, #1, #2] &, {5, 5}, {0, 0}] $ \left( \begin{array}{ccccc} P_{0,0} & P_{0,1} & P_{0,2} ...
-2
votes
0answers
25 views

“Extract” certain elements of a list of “rules”? [duplicate]

I have the following list: {u1[0] -> 3773.62, u2[0] -> 3773.62, u3[0] -> 48.7871} I need to extract the elements on the right hand side of each rule ...
1
vote
1answer
28 views

Histogram and Random Lists [closed]

Suppose I have the following list listrand of random numbers from RandomReal[-30,30] (where the size of the list is 40). Is ...
2
votes
1answer
66 views

How to find the local minimum points in the multi-dimensional numerical data?

I am trying to get some local minima of an n-dimensional function (which only has numerical form). For two-dimensional function data, we can find the local minimum points from the contour plot easily. ...
1
vote
3answers
112 views

Scatter plot with smooth lines [closed]

I have two lists of data between which there may be some functional dependence. I want to plot one against the other (hence scattered plot) where the points are connected by smooth lines. In ...
1
vote
1answer
58 views

Assign List of Vectors to List

I want to assign a list of vectors (though each only contains one) to a list. For example, create list called "eVectors" and do ...
1
vote
2answers
90 views

How to find the palindromic number I'm looking for?

I'm looking for a number which is the same when you read it reverse like 101 or 878. I have to get all numbers from 10 to 1000. There are 99 numbers. ...
5
votes
2answers
72 views

Nested permutations

I would like to compute all "nested permutations" (not sure if it's the right term) of a list consisting of simple elements (numbers, strings) and simple sublists (level 1 lists of simple elements). ...
0
votes
1answer
39 views

How to delete some elements from a list? [duplicate]

This question is asked quite often but none of the answers I found seem to do what I want. I have a list ...
3
votes
5answers
295 views

Function involving For loop

I've written the following function (the code includes the output): ...
2
votes
1answer
111 views

Need Help Writing code to find Capparelli Partitions

I am trying to add multiple criterion to IntegerPartitions[n] so that it sorts only partitions that fit the criterion. It creates a list of list of numbers in ...
6
votes
1answer
94 views

Split list into overlapping sublists

I would like to split a list into overlapping sublists! I want to generate a first sublist with a specified number of elements. Then I want to shift one element to the right and generate an ...
1
vote
0answers
52 views

Compile a listable function to be applied over list of lists [closed]

Consider a simple function g[x_,y_,z_] := x + y + z; (indeed, any multivariate function g will illustrate the same thing). ...
0
votes
1answer
39 views

Could I use Select with condition on any column other than First (Last)? [closed]

I often deal with huge tables of various functions of randomly generated values for my research. Sometimes there's need to only keep rows which satisfy a specific condition. This is easy with ...
1
vote
1answer
37 views

Selecting last partition in integer partition [closed]

I want to get the last partition from an integer partition. For example: IntegerPartitions[8, {3}] ...
1
vote
2answers
115 views

Doing same operation on multiple files

Is there a way in mathematica to do same operation on multiple files at once? And preferably have the output in a table or list form? I want to do the following operation preferably in few non-labor ...
5
votes
4answers
168 views

How to find the right permutation, which fits to the problem?

I'm new here and I hope I can find some help. I'm from Germany, so sorry for my English. I look for a number, whose digits are all different. It isn't known how many digits it has. But there is a ...
0
votes
1answer
63 views

Extract all elements of an expression in order into a list [closed]

I have and expression a + b + c - d and I would like to generate a list of {a, +, b, +, c, -, d}. I have tried ...
-2
votes
0answers
59 views
4
votes
1answer
102 views

How to transform a list (of sums) into list of summands

Suppose you have the list list={a,Sin[b+c],d+c}. What I want is to transform all elements of list with head ...
1
vote
1answer
92 views

Summation over list elements

As we know, one of the simplest way to do a summation (with special intervals) over list elements is using Sum[list[[i]], {i, 3, 8, 2 }] (*with steps of 2*) for ...
0
votes
1answer
96 views
9
votes
4answers
159 views

Faster position-based duplicate removal in a ragged array?

Take a ragged 2D array: rArray={{4, 2, 1, 0}, {2, 2}, {0, 0, 3, 3, 3}, {4, 0}, {3, 4}} I need to "deduplicate" this, where a duplicate is any element of a ...
0
votes
1answer
45 views

Eigenvalues and Eigenvectors Order [duplicate]

Say I have a list of eigenvalues and eigenvectors produced from a matrix $M$ using the command {eig1,eig2}=Eigensystem[M], which will return the eigenvalues with ...