Hi
Without using a loop, is there a way to find an empty list as showing in the following example?
The idea is to find the location and to replace it by a value (such as -1 or zero for example) prior to chnage it to an array
Paul
Without using a loop, is there a way to find an empty list as showing in the following example?
The idea is to find the location and to replace it by a value (such as -1 or zero for example) prior to chnage it to an array
import numpy as np M = [[1], [], [5]] Mprime = np.asarray(M, dtype=np.uint32)logical error:
Error:ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.
Thanks for your suggestionPaul