In the first case, a = np.array([c], dtype=np.object) numpy knows nothing about the shape of the proposed array.
For example, when you define
d = range(10) a = np.array([d])
Then you expect numpy to determine the shape based on length d .
Similarly, in your case, numpy will try to determine if len(c) exists, and if so, access the elements of c through c[i] .
You can see the effect by defining a class, for example
class X(object): def __len__(self): return 10 def __getitem__(self, i): return "x" * i
Then
print numpy.array([X()], dtype=object)
produces
[[ x xx xxx xxxx xxxxx xxxxxx xxxxxxx xxxxxxxx xxxxxxxxx]]
On the contrary, in the second case
a = np.empty((1,), dtype=np.object) a[0] = c
Then the form a already defined. That way numpy can just assign an object directly.
However, to some extent this is true only when a is a vector. If it were defined with a different form, then access to the methods would still occur. The following, for example, will call ___getitem__ in the class
a = numpy.empty((1, 10), dtype=object) a[0] = X() print a
returns
[[ x xx xxx xxxx xxxxx xxxxxx xxxxxxx xxxxxxxx xxxxxxxxx]]