Tagged Questions
5
votes
1answer
103 views
nested use of Apply/Map/MapThread in pure functions
1. My main question
I have a function with two argument slots. I wan't to apply this function to 2 lists with different length's. I thought in this solution:
...
1
vote
2answers
52 views
How to construct a new list made from a function that operates on two lists
I need to take two lists (each list contains the number of moles of a chemical). I have a function calledFraction that takes the each entry of the list and then calculates the mole fraction of ...
6
votes
2answers
192 views
Map a function over the columns of an M x N array
I have a $N \times M$ list of lists, or rather, a list of records and I want to map a function over its columns (e.g. find the mean temperature, age, etc.). Map ...
8
votes
4answers
289 views
What's fastest way of defining 10^5 down values?
I want to define
isGood[___] = False;
isGood[#] = True & /@ list
where list is a list of several million integers. ...
23
votes
12answers
812 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 ...
7
votes
3answers
240 views
how to efficiently apply function to all pairs of a set (and collect the results)
To build a graph, I need to apply a function f[a_, b_] to all pairs of a list (3500 elements). The function itself returns a link ...
1
vote
2answers
143 views
Expectation over a list with nested-mapped expressions
I need expected values of a list where the random variable to take expectations over should be an input into expressions defined earlier. I suspect Set[] and SetDelayed[] tripped me. (Or Map and ...
