ValueError: expected an ndarray

That was the problem! Thanks! It is working now.