I'd like to create a numpy ndarray with entries of type ndarray itself. I was able to wrap ndarrays into another type to get it work but I want to do this without wrapping. With wrapping a ndarray x into e.g. the dictionary {1:x} I can do
F = np.vectorize(lambda x: {1:np.repeat(x,3)})
F(np.arange(9).reshape(3,3))
and get (3,3) ndarray with entries {1:[0,0,0]} ... {1:[8,8,8]} (with ndarrays). When change F to F = np.vectorize(lambda x: np.repeat(x,3)) numpy complains ValueError: setting an array element with a sequence. I guess it detects that the entries as arrays themselves and doesn't threat them as objects anymore.
How can I avoid this and do the same thing without wrapping the entries from ndarray into something different?
Thanks a lot in advance for hints :)
otypes=[object]might getvectorizeto work.vectorizeusesfrompyfunc, but changes the returned dtype.