The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
69 views

Using Map sequentially

I'm trying to simulate the probability of a balanced hand in Bridge (The Theory of Probability by Santosh S. Venkatesh, 2013) using Mathematica. The problem is solved in the textbook but I just wanted ...
0
votes
0answers
29 views

Why does ParallelMap throw errors where Map does not?

I am encountering a problem with ParallelMap. I have a call in a large code base, part of which attempts to fit data in parallel using ...
0
votes
1answer
47 views

Tutorial for Map, Apply, etc

I have this code: ...
1
vote
1answer
61 views

Misunderstanding the difference between Map Apply (@@@) and Map (/@) [duplicate]

Here's a minimal working example of a problem I'm having: ...
4
votes
1answer
138 views

MovingMap maps to second level unexpectedly

I'm trying to build a financial indicator in mathematica. I import some historical data ...
1
vote
3answers
94 views

MapThread (or alternative) for adding fixed option

I currently use MapThread[f, {{a1, a2}, {b1, b2}] for obtaining { f[a1, b1], f[a2, b2] }. Is there a version (or alternative) ...
0
votes
2answers
68 views

How to change list to a list of points

I have a list of angles {a1, a2, .... , an} and I would like to have a list of points ...
7
votes
5answers
188 views

How to Map a function with HoldAll attribute

First of all, I'm not sure about the title of this question, so please correct me if there is any title more sensible than mine. The problem is the following: I have a function f that checks if a ...
2
votes
1answer
61 views

Fixed Points Problem with 2D Mapping

I have been playing with the mapping given by ...
3
votes
1answer
85 views

Parallel Apply on a deeply nested expression

I have a deeply nested expression, i.e. something like {{{{...}..}..}..}, and I'd like to use Apply in a parallel fashion, e.g. ...
7
votes
3answers
330 views

Functional equivalent of a For loop referring to consecutive elements in a list

I have implemented this function which smooths the values in a list by, if it encounters a zero, replacing this entry by the average of its two neighbours (apart from the first and last values of the ...
2
votes
2answers
140 views

Adding map to 3D plot?

I've made a 3D plot of a pressure surface over the region 160W-20W, 20N-80N - the right panel and I would like to put a map under it, probably just continental outlines for simplicity. I'm just ...
2
votes
0answers
32 views

Is there an equivalent to MovingMap[] for functions that work on more than one TimeSeries?

I have a family of functions that require two TimeSeries (A and B). As a trivial example, imagine a function called beta[tsA_,tsB_] that determines the slope of the linear regression line for the ...
4
votes
2answers
106 views

Indexed Thread on dataset and list

I currently have a dataset, and I would like to add a column based on another list. For example: ...
2
votes
2answers
70 views

How to use select and map together

I have two lists, list1 and list2. I want to Select from ...
0
votes
2answers
49 views

How to continuous apply a function to an argument? [duplicate]

In order to calculate x = sqrt(1 + x) for a given number x, 40 times, I tried this: ...
1
vote
1answer
46 views

Summimg peculiar nestings

I have some lists with peculiar nestings: ...
3
votes
3answers
228 views

Use map on a different level

I have just started to get used to Mathematica's Map, Apply, and related functions, and I can't figure out how to do maps that require working "one level down". For example, I am currently trying to ...
0
votes
0answers
75 views

map of Europe as histogram

I want to make a histogram using the map of Europe, such as this or similar: thanks to all
0
votes
1answer
50 views

Fastest way to make division between a number and elements in a list [duplicate]

I have a list y={{a,b},{c,d},...} of dimension {10^5, 2}, and number x. I want to divide only the second part of each element of the list by x, and have as result a new list {{a,b/x},{c,d/x},...}. ...
0
votes
1answer
81 views

Superpose a map and a region plot

I would like to add on a map of city a region plot, which is this one in this case : ...
2
votes
1answer
100 views

Why is Nearest not giving me expected result

I have the following list: numbers={0.,0.6,0.8,1.,1.2,1.4,1.8} Then I calculate the midpoints: ...
0
votes
1answer
44 views

Elegant ways of solving this file batching task

There are a batch of data files in a folder (dir = "D:\\Documents\\datadir"), each of which consists of a list of data items, one per line. Each data item is a pair ...
2
votes
3answers
84 views

How to test a condition for a list and output all the expression that is true?

Suppose that I have a list lis={x-y,x+y,x*y}; and a function f[a_,b_]:=#/.{x->a,y->b}& I want to output all the ...
4
votes
2answers
71 views

Count the number of element repeats at various distances

I have a function of x: f[x_] := Abs[Extract[list, x + n] - Extract[list, x]] I then apply this: ...
1
vote
1answer
66 views

For loop with MapIndexed and If [closed]

I have a for loop that uses MapIndexed and If to build a a list called avald1. The problem ...
2
votes
2answers
156 views

How to Map each cell in a matrix to another and solve the system?

tab1 = {{a1, a1 + a2}, {b1, b2*b2}} tab2 = {{2, 5}, {5, 2}} I want to map like this ...
4
votes
1answer
79 views

How can Map be given access to the keys of a Dataset?

Consider an example Dataset: ...
0
votes
1answer
27 views

MapThread with incompatible length (How to Map twice in the same line)

l and b are two lists of vectors with different length. I need the list of vectors that is constructed by adding each member of ...
5
votes
2answers
266 views

Mathematica periodic moving map

I am pleased to have MovingMap in Mathematica 10. But, today, I encountered the problem that needs MovingMap with a periodic boundary condition. To be specific, Consider the following example. ...
2
votes
1answer
113 views

Excluding cases from Map

I'm doing operations of the form: PowerMod[#, -1, 126]+# & /@ Range[1, 125] When a number is not invertible, I don't want it to be included in the result ...
2
votes
3answers
71 views

How to manipulate one column of a table using the value in another column

Let's imagine I have the following table structure data = {{a, b}, {c, d}, {e, f}}; and I want to transform it into the following table ...
3
votes
1answer
43 views

Mapping also for one element (or telling it how to do so if head got changed)

Some code generates a polynomial, and has the form: expr = Plus[a[i],b[i],c[i],d[i]] I need to apply f to each term. To do ...
2
votes
2answers
63 views

Partial application of MapThread

Suppose that I have f[a_, b_, x_] := ... I'd like to create a list of n pure functions ...
8
votes
3answers
328 views

Operate over list of pure functions

I have list of pure functions (All functions are InterpolatingFunction) i.e {{a, b}, {c, d}, {e, f}, ...} and I would like ...
2
votes
3answers
119 views

MapAt a function at specific positions

I'm trying to solve for $p3$ in 3p3-5 = p1 + p2 at positions where p1*p2 == 0: ...
1
vote
0answers
75 views

Elementwise operation, part deux [closed]

There are many answers to this question: which are forms of Mathematica's map, but languages like Scheme (I think also Python in recent years) also provide a ...
5
votes
1answer
134 views

Mapping over an association producing an unexpected result

The documentation for associations says that the keys of an association are transparent for many operations. Map is one such operation. However, I am confronted ...
6
votes
3answers
181 views

Mapping a function over the parts of a deeply nested Array

I have two tensors: tensorS = Array[Subscript[s, #1, #2, #3, #4] &, {2, 16, 16, 19}]; tensorR = Array[Subscript[r, #1, #2, #3] &, {2, 16, 19}]; ...
5
votes
2answers
125 views

Is there a built-in function to map a list of heads to a list of data?

Assume that this built-in function is called func. What I want is func[{f,g},{a,b,c}] will return the following result: ...
16
votes
4answers
365 views

Make MapIndexed listable

My goal is to apply MapIndexed to every element of a nested list without destroying the arithmetic operations within the elements. For example, let's start with ...
4
votes
4answers
118 views

Plot range of a 2-dimensional function as a function depending on one variable

I want to plot a function of 2 variables x and y, for discrete values of y, like: ...
0
votes
1answer
92 views

Map Elements of a list to be Index of matrix

I have a sublist from Tuples[{1, 2, 3}, 2], say for example L={{1,2},{2,1},{2,2}}, and a 3 x 3 matrix ...
6
votes
2answers
292 views

Apply function to every element of list regardless of depth

I want to apply a function to every element of a list without taking braces into account (depth level), but with the same form of output. Here is an example : ...
0
votes
1answer
93 views

ParallelMap returns incorrect results over Map

I've written a function to pull in the useful column of a large data file: ...
26
votes
3answers
684 views

Changing Values in an Association using Map

I am trying to change the value of one key in an association based on the value of another key in that association. So if my association starts as: ...
2
votes
2answers
127 views

Map 2 list to a function

Im playing around with CountryData and I want to pass it 2 lists as argument, listCountries = {...} and ...
4
votes
1answer
501 views

Why is there a huge performance gap using Map with more than 100 List entries

im using Map on a List like this: cube= {{1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, ... , {5, 5, 4}, {5, 5, 5}} Mapping the whole List with 125 entries takes ...
2
votes
1answer
89 views

Can I use Map here rather than Table?

I've got something that works, but it seems like it would be "nicer" if I didn't have to use Table (or For, etc.). I've got 3 Excel files, each with multiple sheets. Each file also has a sheet ...
1
vote
4answers
207 views

Unexpected result from Map [closed]

I'm using Mathematica 8.0. Is the following output a bug or do I miss something? f[a_] = 2 a; Map[f,1+x] gives $2+2x$ as expected, but ...