416 views

### Apply multiple functions to parts of a nested list [duplicate]

data = {{1, a, x, "one"}, {2, b, y, "two"}, {3, c, z, "three"}} I want to apply a list of four functions {f, g, h, m} one ...
122 views

### Matching each function to each element [duplicate]

Assume that you have two lists of the same size where 1st contains functions for ex. {u,i,o,p} 2nd contains numbers for ex. ...
313 views

### Produce {f[x],g[y],h[z]} in as many ways as possible [duplicate]

I have two lists of equal lengths but for my task I will use 3-element lists , namely {x,y,z} and {f,g,h}. The first contains ...
130k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
3k views

### Map a function across a list conditionally

It seems that this is a really basic question, and I feel that the answer should be obvious to me. However, I am not seeing. Can you please help me? Thanks. Suppose I have a list of data ...
3k views

### Apply multiple functions to same list

I'd like to get the Min, Max, Median, Mean, etc. for the same list. For now I'm doing the following: ...
742 views

### Distributing elements across a list of lists

I have two lists: u = {{1, 3}, {2, 6}, {3, 9}} v = {0, 4} and I want to obtain this list from them: ...
657 views

...
756 views

### How to sort list of mixed types of elements with each type a specified canonical order?

For example, here is a list {{1, "u"}, {6, "d"}, {3, "u"}, {4, "d"}, {2, "u"}, {5, "u"}, {3, "d"}, {1, "d"}, {4, "u"}, {2, "d"}, {5, "d"}, {6, "u"}} The ...
326 views

### Command to insert item into list

Is there a command to insert an item into a list such that they form pairs? In other words to take InsertObject[{a,b,c},d] which will output ...
216 views

### Elegant way for element-wise application of a list of functions

For given functions $f,g,\cdots$ I want to define a pure function that, when applied to any list $\{x,y,\cdots\}$ (of the same length as $\{f,g,\cdots\}$), produces $\{f[x],g[y],\cdots\}$. Two ways to ...
189 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: <...
141 views

### Using Through on functions that take multiple arguments

I want simple syntax that results in this: {{f[1, 2], g[1, 2]}, {f[3, 4], g[3, 4]}} though I'm willing to settle for: ...