Link to np.fromfunction documentation
I would like to fill an array with values as a function of its indices.
Link to np.fromfunction documentation
I would like to fill an array with values as a function of its indices.
maybe this?
map(f, Iterators.product(1:nrow, 1:ncol))
# or a simple for loop
[f(i, j) for i in 1:nrow, j in 1:ncol]
Thanks! map is what I’m looking for.
I assume using map is better? Do you know if they are the same under the hood?
for comprehension is always faster
I just tried it out, you’re right! That’s interesting…
Thank you!