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

learn more… | top users | synonyms (3)

0
votes
1answer
57 views

Manipulating lists with constant values [duplicate]

let us assume we have some data in the following form. Table[data[[1,i,{1,2}]],{i,1,Length[data[[1]]]}] This would give all $x-y$ pairs of the first file. What I ...
1
vote
1answer
85 views

How to find the maximum values and the place of the max value in the list? [duplicate]

I have given an example to find the maximum value and its place in the list. Is it possible to find the local maximum in the sub-list of this list means local maximum in the each row of the list and ...
3
votes
0answers
79 views

Why does Part behave like it transposes lists? [closed]

From the documentation of Part: Part[expr,i,j,...] is equivalent to expr[[i]][[j]]... ...
3
votes
2answers
115 views

Converting unevaluated lists to strings

I have a list like l = {2 - 3, 12 - 4, Times, aab} I want to end up with {"2-3", "12-4", "Times", "aab"} I have tried ...
8
votes
1answer
137 views

Strange behavior of BinCounts

Bug introduced in 8.0 and fixed in 10.0.0 Just try this example: ...
2
votes
2answers
149 views

Building adjacency matrix from set data

I have two sets: games and players. Players pick their games. As such I will have data say g1={p1,p3,p5},g2={p2,p4},g3={p2,p3,p5}. My interest though is to build the connections among players because ...
4
votes
1answer
157 views

Selectively converting numerical strings to expressions

I have a list of strings representing different types of data ...
2
votes
1answer
48 views

Grouping Nested Lists Based on Differing Values of Single Element

I've a list of lists representing k-rows of truth table having n elements each in a nested list consider ...
0
votes
1answer
51 views

Generating list of functions from list of expressions

I know how to create a function from concrete expression like Function[{x, y}, x^2 + y^2] But what if I have a list of expressions list1 and I know the set of ...
1
vote
2answers
85 views

Manipulate which creates and deletes Manipulators dynamically

I want to plot a function in a Manipulate in which the number of terms varies and a Manipulator for the coefficient of each term ...
0
votes
1answer
115 views

Select positive value from a vector

I am wondering how to pick out the positive Omega value from soln, and make these positive values into a row vector. I know how ...
0
votes
1answer
67 views

How to discriminate Weatherdata latitude and longitude from a more detailed list

From this list of weather data how can I discriminate only latitude longitude for each station? For example from the following sample I would need only the coordinates: "50136","","Aoluguya|Mohe, ...
1
vote
2answers
110 views

How to drop the identical rows and columns of a matrix?

I'm currently trying to find a way to eliminate from a square matrix of generic dimension the duplicate (up to sign) rows and columns, obtaining a smaller dimensional matrix. I searched around here ...
0
votes
1answer
98 views

How do you add options to a function that is being mapped?

Simple example: Normally: ListPlot[list, Joined->True] If I want to map ListPlot how do I keep the ...
1
vote
2answers
174 views

From a list of (x,y) pairs, generate a new list of (x,ymean) pairs, where ymean is the average of all y's with the same x in the original list [duplicate]

This seems like the sort of thing where Mathematica can give a very simple solution. I have a list of points {x,y}: ...
0
votes
2answers
81 views

Merging two lists by prepending elements

Being a newcomer to Mathematica, I have the following question. Given x = Range@9~Partition~3; and y = {a, b, c}; I want ...
1
vote
1answer
73 views

How can I get a certain kind of iteration? [closed]

Can I get this type of do-loop in Mathematica? Do[Print[j," ",k," ",l], {j,k,l, {a, b,z}, { c, d,y} }] I want this to work so that, in the first iteration, ...
0
votes
1answer
113 views

ListDensityPlot with discrete bins [duplicate]

We consider a table of the form data = Flatten[Table[{i,j,f[i,j]},{i,1,ni},{j,1,nj}],1] The function f[i_,j_] has been made ...
2
votes
0answers
82 views

ParallelTable and expensive functions

I would like to build up a 2D-Table using ParallelTable as follows ...
0
votes
1answer
63 views

How to take single item out of List? [duplicate]

I often get Lists that contain a single item, like {name} or {{2,3,4}}. Is there a function ...
2
votes
2answers
109 views

Extracting “records” from a matrix

From a rank 3 matrix like ...
4
votes
2answers
448 views

What is the Mathematica way of joining two tables?

Is there a special Mathematica way of joining tables of data together, so that I would get similar functionality as if I was running a database with sql? For example, I have one particular table ...
2
votes
2answers
91 views

Componentwise Addition of TemporalData

I'm a little confused with the TemporalData structure in Mathematica, in the sense that it doesn't seem to behave like a list. What I'd like to do is plot the sum ...
0
votes
1answer
86 views
2
votes
1answer
143 views

Find positions where two matrices differ

I have two matrices A and B of identical dimensions. What's the simplest (shortest) way to find the indices of differing ...
0
votes
1answer
63 views

Extract Position where value is unequal to 0 [closed]

When I use Position[somelist,0] I get the position where values are 0. But what would be the command to get the positions which are unequal to 0 ...
0
votes
1answer
57 views

Drop last element of parts of a list [duplicate]

just a simple question for now I guess: I have a list: list={{1, 2, 1}, {1, 10, 1}} I simply want to Drop the last element of the two entries of the list, that ...
1
vote
3answers
151 views

How do I select only those lists whose elements are all above a certain number?

I'm essentially doing coin flips, using RandomReal to populate a bunch of lists, each with 8 elements. I then want to select only those lists for which all elements are greater than a certain number, ...
1
vote
1answer
124 views

How to define a list that contains all primes less than x?

how can I define my own list in which I have all primes less than x?
0
votes
1answer
38 views

save all inputs as list [duplicate]

I received three results of calculations: {k->0.190729} {k->0.197575} {k->0.249319} Could you help me write the results in the following form: ...
0
votes
2answers
225 views

ListPlot with spherical coordinates with data from file [closed]

I have a file that is a table of values for r, $\theta$ and f(r,$\theta$) with r and $\theta$ being spherical coordinates, $\phi$ being 0 the whole time. The data thus looks like ...
3
votes
3answers
250 views

How to insert elements of a list into list of lists?

I have two lists. E.g. ...
0
votes
2answers
113 views

Having problems with ListPlot and a PaddedForm wrapper

I defined a function f[x_] = x^3 2 x. Then I had to construct a table showing vertically, the values of f corresponding to x on ...
10
votes
2answers
550 views

Faster “stuttering” accumulate?

Given some list of arbitrary precision numbers, e.g. (actual lists are 1M+ elements long): test={0, 2, 2, 47839283, 2, 0, 0, 2, 0, 1, 2, 0} I need to accumulate ...
2
votes
2answers
218 views

Generating complete lists of polynomials

I would like to generate a list of all $3$-variable Laurent polynomials with non-negative integer coefficients using a looping construct so that I can, one-by-one, check them for specific ...
2
votes
2answers
248 views

List density plot for non-uniform data

I am trying to make a density plot to show the data that can found here. I tried with GNUplot previously. The result of GNUplot density plot for a rectangular set of data. I am able to do this only ...
1
vote
1answer
95 views

What is wrong with setting one list to another within function? [duplicate]

I have built a function which carries out a set of operations given two parameters. The function looks as follows: ...
1
vote
1answer
237 views

How to find non zero elements of a list containing zeros and symbols

I have a list, obtained after differentiating a list of expressions, which contains zeros and symbols, say: A = {x1^2, x2^2, x3^2, x4^2} D[A,x3] results in the ...
0
votes
0answers
23 views

How to put the values/points in a loop into a plot? [duplicate]

I've already make the do loop..it has 200 points..how am i going to put those points into a plot?do i need to make a list@table before doing the plot?here's my loop example, ...
2
votes
2answers
169 views

Create Table of replacement rules

I want to create a table of replacement rules. ...
1
vote
0answers
43 views

Replacing list elements by other list elements [duplicate]

I am a beginner of Mathematica and need some help for the following issue. I have the following two lists: ...
12
votes
3answers
349 views

Taking Top K Occurrences

Having millions of numbers in a list, I want to take top K occurrences. MMA Commonest is very slow so I write my own versions: ...
5
votes
3answers
233 views

Split list of states by run lengths and discontinuous changes in state

I was asked to look into writing some simulation code for a user, where the simulation output (x) would oscillate between three possible states: ...
6
votes
1answer
421 views

Stacked Line Graph with fragmented data

Let's start with what I already found on the internet: ...
0
votes
0answers
84 views

How to save the results in an identical Excel file (.xls) in each iteration of a Do loop

Assume the following code (Below code is just an example to clearly illustrate my problem): ...
1
vote
3answers
144 views

How to make list plot when all information is in a single list

I want to make a plot , where the data is structured like so { {"l1", "l2"}, n1, n2, n3} } The values in the inner sub list are labels which are associated with ...
0
votes
0answers
39 views

Filter sublists that contain a certain value [duplicate]

This question is a followup from appending elements to sublist mergedList = { { {"a","b"}, -1.5, -5, "no" }, { {"c","d"}, -2,-10, 7 } } I ...
0
votes
1answer
70 views

If statements with a Boolean [duplicate]

If I have a vector {1,2,3}, I want to write an If statement, where if one of the positions is "1", it will perform a certain command. ...
2
votes
3answers
186 views

appending element to sub list [duplicate]

I have a list of the form: lstA = { { {"a","b"}, -1.5}, { {"c","d"}, -2 } } I wanto to add another value to each sublist that ...