def test_string_to_char(self): array = np.array([['ab', 'cd'], ['ef', 'gh']]) expected = np.array([[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]]) actual = conventions.string_to_char(array) self.assertArrayEqual(actual, expected) expected = np.array([[['a', 'b'], ['e', 'f']], [['c', 'd'], ['g', 'h']]]) actual = conventions.string_to_char(array.T) self.assertArrayEqual(actual, expected)