I found a workaround but it's a bit ugly: def some_call(x): rval = numpy.array(None, dtype='object') rval.fill(x) return rval
-=- Olivier 2011/7/12 Johann Hibschman <[email protected]> > Is there any way to wrap a sequence (in particular a python list) as a > numpy object scalar, without it being promoted to an object array? > > In particular, > > np.object_([1, 2]).shape == (2,) > np.array([1,2], dtype='O').shape == (2,) > > while I want > > some_call([1,2]).shape = () > > Thanks, > Johann > > _______________________________________________ > NumPy-Discussion mailing list > [email protected] > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
