Let's say I have a list of Numpy arrays with varying shapes and need to replace all values of 255 with 1.
A = np.array([[0,255], [0,0]])
B = np.array([[0, 255,255], [255,0,0]])
list_of_array = [A, B] # list could have many more arrays
Methods like np.place() and X[X == 255] = 1 do not work on lists.