def object_array(*args):
 array = np.empty(len(args), dtype=object)
 for i in range(len(args)):
  array[i] = args[i]
 return array

def object_array ( * args ) : array = np . empty ( len ( args ) , dtype = object ) for i in range ( len ( args ) ) : array [ i ] = args [ i ] return array
constructs a numpy array of objects .