# Questions tagged [map]

Questions about applying functions or operators to expressions, especially constructs that take advantage of Map (/@) functionality.

308 questions
Filter by
Sorted by
Tagged with
45 views

### Mapping on changing list

for those who have seen it, I have deleted my previous question, as suggested by @Αλέξανδρος Ζεγγ, The goal : Modifying dynamically the list on which a mapping is done I try to give you a concrete ...
12 views

### NIntegrate arguments and non-numerical lists

Having two lists a = {1,2,3} b = {4,5,6} and a function f[lo_, hi_] := NIntegrate[x^2, {x, lo, hi}] I would like to ...
59 views

### Iterate Minimize on a list of functions

I have a function $f$ defined on $[-1,1]$. For a minimal example, it suffices to define f[z_]:=z^2 - 1 I need to find a list of points such that $f(z_0)= f(z_1)$,...
28 views

### Map of an expression in a 3D grid is very slow

I have a quite large expression as function of $R$, $\phi$ and $Z$ as you can see: ...
21 views

### Optimization of storages capacity

Consider a series of storages where different goods are added into daily. I would like to optimize the distribution of these goods between the storages in a way which takes into account some ...
72 views

### How do I create a bifurcation diagram for the below iterative map? [closed]

I have tried to create a bifurcation diagram for the following iterative map: x[n+1]=-r Log x[n], x=0.711 and r=1/log(n(n+1)) using the following code But it doesn't work. Any help? ...
253 views

### Is it possible to speed up this code by eliminating “For” loop?

I am finding how to speed up a code. The code and general equation are as below. ...
68 views

### Sorting list on multiple criteria based on means of subgroups

I have a set of records where each record is for a particular item. An item is a member of a particular subgroup and a subgroup is a member of a particular group. One item is always a member of a ...
86 views

### Iterative comparison between different vectors

I have some soccer outcomes for each league round to import in a data form similar to that: ...
94 views

### Import data from different webpages of the same website

I imported and cleaned the following datasets for england soccer league in order to have home/away rank tables and next round matches: ...
50 views

### Code a function to obtain an output table from an input dataset taking into account some rules

Good morning, I have an input dataset in the following form: ...
44 views

### Indexed KeyValueMap

I have been trying to figure it out and I am probably very close, but I have spent 2 hours without sucess. I have the expression below ...
47 views

### Automating a code to use Map function, using it to plot with ListLinePlot command and plotting with certain imposed conditon

I have a code which goes like this: ...
44 views

### AppendTo inside ParallelMap

I think this question has never been fully answered. In here the problem has already been mentioned, but let me give a MWE. I will solve a given ODE for a wide range of initial conditions and I want ...
63 views

### WhenEvent with a function

I have the the function kill[x_]:=Map[#->0&,x] which is supposed to set a list of functions to zero. That seems to be working, because ...
91 views

### Add a legend to a combined Plot

I have trouble adding a second legend to this map (see picture underneath). I need the legend to that show each existing bubble size, with the respective rainbow color (from the map) and with the ...
122 views

### How to get 3D building data in map functions?

Most modern mapping APIs have 3D model data for city buildings built-in. For example: Is there some way to get this functionality in the Geography related functions? I believe ...
226 views

### Determining moving ratios over a list

To know how fast values in a list approach 1 I tried #[]/#[] & /@ Partition[{5040, 1460, 280, 76, 16, 2, 1}, 2, 1] This works, but I seek a better ...
40 views

### How to map a list of entities into a function?

x = RandomChoice[CountryData[]] Here I have defined x to be a random country. ...
54 views

### How to apply command to all elements of a list?

So I generated a list of cities and I want to apply FindGeoLocation to all of them without having to seperate the elements and then applying. ...
35 views

### Defining a function and order of operations

I feel I have a profound misunderstanding of how Mathematica works. Here's an example that confuses me: Say that for a matrix $A$ I want to extract the first $\mathrm{Tr}(A)$ normalized eigenvectors (...
114 views

### Function which returns a symbolic jump between two ordinates, e.g. $[f(a,b,c)]^+_- = f(a^+,b^+,c^+)-f(a^-,b^-,c^-)$

I want to create a function in Mathematica which accomplishes the following: $$[f(a,b,c)]^+_- = f(a^+,b^+,c^+)-f(a^-,b^-,c^-)$$ where $f$ is any function (has 3 arguments above but this need not be ...
57 views

### Concisely operate on RHS of list of rules

I have a length-N list of rules l = {a -> 5, b -> 1, c -> 42} and an length-N vector of scalars... dl = {-1, .2, 5} ...
108 views

### Visualizing the Riemann's mapping theorem [closed]

The Riemann's mapping theorem allows to map any simply-connected domain in the complex plane $\mathbb{C}$ conformal onto the open unit disk. Conformal is meaning preserving angles. This is a complete ...
54 views

### Why does a list of Iconize objects not work with Map

I am trying to understand how to Map a function onto a list of Iconize objects. Here is a simple example: listOfIconize = Table[ Iconize[Range[10 + i]], {i, 1, 3}] ...
53 views

### Chaining map and abstract functions — when (and why) is parenthesization necessary? [duplicate]

I am a bit confused with how do some expressions in Mathematica get parsed. I was using a combination of map (/@) and abstract functions of the form ...
16 views

### Can I use Postfix with a condition [duplicate]

I have a nested list Data set with mostly numbers, there are a few elements that occur as strings that I want to convert to a number. By postfixing ToExpression I ...
45 views

### Order or function/list arguments in map/select/others

I keep being uncertain of the correct order of [function,expr] arguments to functions such as Select, Pick, Cases, Position, etc., because I'm used to the ...
39 views

### Mapping a flat unit plane composed of polygons onto a cylinder

I'm looking to map a flat plane composed of triangles onto a cylinder, and then ultimately use a manipulate function to show the plane wrapping into a cylinder. Here is the code I have so far, I've ...
70 views

### Map list of functions over list of inputs

Given a list of functions {f1, f2, f3, ...} and list of inputs {1, 2, 3, ...} I wish to produce the list ...
50 views

### How to efficiently select positions of elements in a sublist

Apologies if this is an already answered question, I was unable to find anything until now. I believe the answer will be quite simple, I have just been stuck on it for a few days now. I have a large ...
44 views

### Generating a directed graph from a map of flows

I have generated a stream plot, with curves on it using the following code: ...
216 views

### Generate an array with custom index

Apologies if this is a duplicate. I am trying (but failing) to generate the following n x n matrix in Mathematica: where G[tj, t0] is a function along the main diagonal and G[tj, tj] is a function ...
111 views

### How to transform an UpperDiagonalMatrix into a symmetric matrix in Mathematica 5.2?

I have an UpperDiagonalMatrix as the following, how to transform it into a symmetric matrix in Mathematica 5.2? Note: don't use the command ...
698 views

### Mapping string into integers

Suppose I have the following list, l = {{"b", "c", "d"}, {"e", "b"}, {"a", "b", "d", "e"}} and further suppose I have the following association, ...
169 views

### How to convert list of variables x1, x2, x3 ,x4 … x10 to list of x1_,x2_,x3_..x10_?

I'm writing a function where I need to give many inputs. I created a list of variables from Table function. My aim is to get ...
119 views

### Appending to each string in a list with mapping

I have a list of 100 things: endings = ".w_" <> ToString[#] <> "_cold.r_0" <> ".xvg" & /@ Table[i, {i, 0, 99, 1}] And I'm trying to add 20 ...
70 views

### Is there a good reason why Slot[] is not an atomic expression?

Here's a good reason why I think it should be, Map[ If[AtomQ@#, #->"is an atom", #->"not an atom"]& , {"hello",Range@3, # &} , {-1} ] ...
454 views

### Map a function that takes arguments in different levels of a list

I would like to map a function that takes as an argument a list in a list of lists and an element of the list of lists. So for example, this is my list of lists: {{4,1}, {3,1,1}, {2,2,1}} I ...
40 views

### How can I consolidate mapping code between different levels of lists?

I have a list with the following structure: ...
554 views

### List, map function based on a condition

I have the following list: ...
106 views

### Map vs. Table for index-specific operations on 2D arrays–Part II

This is an extension of my recent question, Map vs. Table for index-specific operations on 2D arrays For that question I gave a minimal working example, since I was more interested in learning ...
66 views

### Combine a List of Plots: Using MapThread with Show [closed]

I have a list of graphics p1 = Plot[x Sin[x] - 1, {x, -2.5, 2.5}] p2 = Plot[Evaluate[D[x Sin[x] - 1, x]], {x, -2.5, 2.5},PlotStyle -> Red] ListNew = {p1, p2}; ...
256 views

### Map function over two lists

How to map a function over two lists, first one and than the other? For example, assuming I have two lists {a,b,c} and {d,e,f}: ...
431 views

### Map vs. Table for index-specific operations on 2D arrays

Many experienced users on this site tend to use Map (and its variants, MapAt, MapIndexed, etc.) rather than Table. When applying the same operation to every element of an array, Map does seem more ...
105 views

### Creating a new Dataset column using a map from a second Dataset

Say I have two datasets: one is a detailed list of events, and one is a coarse list of events. I want to add a column to the detailed list from the coarse list (for the purposes of sorting). For ...
71 views

### A map function in a simulation problem

This is a continuation development of another post by @Dr. Wolfgang Hintze and deserves credit for the code work presented here. My modification was to include simple mapping to allow compare the ...
61 views

### Moving map with non-overlapping window

How can I apply a function to a list with non-overlapping window. E.g. $data = \{x_1, x_2, ...., x_n\}$ and we apply f with window size 2 to get $\{f(x_1,x_2), f(x_3, x_4), ...., f(x_{n-1}. x_n)\}$. ...