Replacing some elements of an array with corresponding elements from another array

Possibly because x iterates over the scalar elements of A and that code tries to replace such elements by full B arrays.

A comprehension could be used:

C = [a < 0 || isnan(a) ? b : a for (a,b) in zip(A,B)]
6 Likes