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

learn more… | top users | synonyms (5)

3
votes
1answer
127 views

How to efficiently select elements from a Hash?

How can I write an efficient version of the following selection statement: Keys[Select[hash, # < constant &]]; // AbsoluteTiming hash can be made from: ...
3
votes
1answer
1k views

Select row from a table by column value [duplicate]

I have the following: animals = {{dog, black, 200}, {cat, white, 100}, {moose, brown, 500}, {zebra,black,100}} If this came from a SQL table called animals, ...
3
votes
2answers
152 views

Change all values of a series to positive values

I would like to change all values of a series to positive values. I refer to my previous question, answered in the most part, very elegantly by RunnyKine. However, there remains a slight glitch that ...
3
votes
2answers
193 views

Write list of polynomials as a matrix of coefficients times a list of monomials

I have the following problem: given a list of polynomials P = {p1, ..., pn} on the variables x[1], ..., x[n], find a list of ...
3
votes
2answers
136 views

Incrementally revealing Grid (or TableForm) entries

I have a Grid (or TableForm) object like this ...
3
votes
1answer
923 views

A rotation-like transform on a matrix

Do not be confused with comments, those are for previous version of the question - Kuba Imagine I have a matrix of the form: ...
3
votes
1answer
199 views

Combining the items with common available dates from two lists [duplicate]

I have two lists of data including dates such as data1 = {{{yy, mm, dd}, a}, ...} data2 = {{{yy, mm, dd}, A}, ...} There are some missing dates from each list, ...
3
votes
1answer
410 views

Removing sublists containing elements from another list's sublist

Let there be two lists that have sublists: a[] = {{1, 2}, {1, 2, 3}, {2, 3, 4, 4}, {3, 4, 4, 5}} and ...
3
votes
2answers
325 views

Deleting a row or column of an adjacency matrix while maintaining the associated label

I am currently working with a weighted adjacency matrix for a directed graph, and it contains several 0 columns and rows. With the unaltered matrix, I am able to monitor the relations between vertices ...
3
votes
1answer
215 views

How to efficiently take complement of two big lists?

I have a giant list l1 and some smaller lists l21, l21, ..., ...
3
votes
1answer
286 views

How to partition MatrixPlot graphics?

Is there an easy approach - hopefully built-in - to partitioning MatrixPlot graphics into rows or columns (or both) of graphics sharing the same underlying options? ...
3
votes
1answer
348 views

n-fold symbolic integral in Mathematica

I am trying to compute symbolically a n-fold integral (n is a parameter of a function) over, say, the cube [0,a]^n. My code looks like this ...
3
votes
1answer
75 views

List of first elements

I have a list whose elements are (symbol or list) and I would like to replace the inner lists by their first elements. I do this ...
3
votes
1answer
70 views

Duplicate rows with multiple entries

I have a huge dataset, which looks similar to this: ...
3
votes
1answer
61 views

overlap of data

I have two individual Date lists as Date Objects: List 1 = {1 Jan 1991 9 :00 , 3 Jan 1991 11:00 ..etc } List 2 ={ 7 Jan 1991 14:00, 9 Jan 1991 15:00 ..etc} For ...
3
votes
1answer
93 views

Map works but Thread doesn't

This question may be trivial, but I can't get past it for the life of me. I have $n$ matrices of dimension $p_i \times N_i$, with $i$ indexing the $n$-set. I also have $n$ vectors of the appropriate ...
3
votes
1answer
65 views

How can I get the arguments of the function Graph?

If I have f0 = f[x,y,z] and I am interested in the list of the arguments, what I do is ...
3
votes
2answers
82 views

Problem with Custom Sort/Split/Gather

Please help me Sort/Split/Gather/Group(by) a set of symbolic expressions! (extreme TL;DR at bottom) I have a set of symbols (which represent 2-vectors in a plane, ultimately) and I want to ...
3
votes
2answers
88 views

Role of Accuracy in numerical evaluations, SplitBy vs GatherBy

This is a follow-up question to this question. I generated a list by substituting the results of a solve[] routine and set: ...
3
votes
1answer
68 views

Reading an exported List

I have exported a list of 2d coordinates as a List: Export["F:\\coordinates.dat", coordinates, "List"]; You can access the ...
3
votes
1answer
64 views

Generate a new list

Suppose we have the following sample data ...
3
votes
1answer
56 views

FindLinearRecurrence is not working for numerical complex number sometimes?

First FindLinearRecurrence definitely support complex number list, see ...
3
votes
1answer
124 views

Efficiently generating plots from lists of differing lengths

I guess this is more of an informatic question. A quite complicated function of mine generates me a list of valid points, depending on a parameter, like this: ...
3
votes
1answer
121 views

Way to generate all multisets

I have a set $\left\{\{1,2\}, \{3,4\}, \{5,6\}, \{7,8\}\right\}$ (for example) and want to generate all sets of $n$ elements with repetition but without counting the same multiset twice. So I want my ...
3
votes
1answer
69 views

How can I extract parts of a mixed list? [closed]

I have the following list: lst = { {1, {{"abc", "bcd"}, {"cd", "efg", "fghi"}, {"g"}}}, {2, {{"abcd"}, {"bc", "cdef"}, {"defgh"}}} }; By using ...
3
votes
2answers
93 views

How to plot specific lists

Here is a sample of data points: ...
3
votes
1answer
104 views

Using and replacing sequential elements of a list

Very simple question but I am an absolute beginner, so apologies if this has already been answered. I need to pick sequential elements of a list, excluding t=1 and t=T, and use them in a function. ...
3
votes
2answers
120 views
3
votes
1answer
164 views

Union of two or more lists

I have a number of lists (only 3 shown here) ...
3
votes
1answer
128 views

Constructing lists in an efficient way

I have a list of functions and I want to separate them into two lists: a list that contains the functions that have at least one zero and a list that contains the functions that do not have ...
3
votes
1answer
139 views

Creating an autokey cipher function

Can someone help me with putting what I can say in words into code. I want to create autokey encrypt and decrypt functions (just wanting help encrypting and then can figure out decrypting). Everything ...
3
votes
4answers
117 views
3
votes
1answer
204 views

Making a list of rules from the list of elements

Starting from the list: {f[q1, q2], f[q3, q4], g[q1], g[q2, q3, q4], d[k1 - q1], d[k2 - q2 - q3 -q4]} I would like to get the result: ...
3
votes
1answer
99 views

Part specification error only in LogPlot

I've a problem. I defined a simple list and a function like below: lst := {5, 10, 20} f[m_] := lst[[Floor[m/10]]]; and drew a plot ...
3
votes
2answers
121 views

How to modify the elements of a list in a loop?

I have a list with points coordinates. And I'm trying to traverse it and perform some matrix operations on each point. But I have a problem with storing modified points in the initial list instead of ...
3
votes
3answers
325 views

Data Table Manipulation

Suppose that I have the following ...
3
votes
1answer
130 views

How do I get the length of held list without evaluating the list?

I used Extract with Hold to retrieve a sublist containing expressions I didn't want evaluating, e.g. ...
3
votes
1answer
117 views

Recursion when randomizing elements in a list

I want to randomize certain elements of a list; Since the code list = {a, b, c, d, e, f, g}; list[[{1, 3, 5}]] = RandomSample@list[[{1, 3, 5}]]; list works fine, ...
3
votes
2answers
412 views

How to delete all rows in datafile that contain a string

I'm importing some data from a file. However, the file was created by an unreliable instrument, such that the data looks like this: ...
3
votes
1answer
1k views

Plotting multiple lists of complex numbers

The user #Nasser showed an elegant way to plot complex numbers: ...
3
votes
1answer
193 views

Levels and slots

I am struggling with levels and #, if I understand this I think I will be able to grasp the entire concept. ...
3
votes
2answers
114 views

Linear interpolation of a list between periodic anchorpoints

I have a list of the form: list = {1,1,1,2,2,2,3,3,3,4,4,4,7,7,7,19,19,19}; Where we can see that there are an ordered set of integer values that repeat ...
3
votes
1answer
140 views
3
votes
1answer
138 views

Filtering the elements of an array to split them into two categories

So, I am new to Mathematica, and I am trying to write something that involves taking values from one array and separating them into two different arrays. My code for doing this is: ...
3
votes
1answer
491 views

Replace elements in a list

Suppose that I have a list: ...
3
votes
2answers
97 views

How to generate a list from an iterator and some arbitrary function

Suppose I'd like to generate a table of integers: Table[i, {i, 10}] Great; now suppose I want only the integers that are even ...
3
votes
1answer
523 views

Operations on a List of Vectors (Norm)

I have a List containing vectors. The coordinates are random numbers: r = {RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n], RandomReal[{-1, 1}, n]}; Now I want to ...
3
votes
2answers
55 views

How to group this list in to some group whose element have a same number to relate

I have this list list={{0,7},{16,0},{16,2},{12,5},{11,1},{1,20},{3,20}}; This is my current method to realize it. ...
3
votes
2answers
46 views

PlotStyle with nested list

Simple Question from a Stumped Rookie: Using ListPlot, I can't get PlotStyle to look below the first level of a nested list to assign individual saturation values for each point; it assigns the ...
3
votes
1answer
235 views

Minimize sum of array elements subject to conditions

I have array where each point at different times are shown parameters ...