Creating array with single structured element containing an array
问题 I have a dtype like this: >>> dt = np.dtype([('x', object, 3)]) >>> dt dtype([('x', 'O', (3,))]) One field named 'x', containing three pointers. I would like to construct an array with a single element of this type: >>> a = np.array([(['a', 'b', 'c'])], dtype=dt) >>> b = np.array([(np.array(['a', 'b', 'c'], dtype=object))], dtype=dt) >>> c = np.array((['a', 'b', 'c']), dtype=dt) >>> d = np.array(['a', 'b', 'c'], dtype=dt) >>> e = np.array([([['a', 'b', 'c']])], dtype=dt) All five of these