Say I have the following array:
import numpy as np
a = [\'hello\',\'snake\',\'plate\']
I want this to turn into a numpy array b
Specify the string length as the shape parameter with unicode 1 char
> string_array = ['..##.#..#.', '##..#.....', '#...##..#.', '####.#...#', '##.##.###.', '##...#.###', '.#.#.#..##', '..#....#..', '###...#.#.', '..###..###']
> nummpy.array(string_array,dtype=('U1',10))
array([['.', '.', '#', '#', '.', '#', '.', '.', '#', '.'],
['#', '#', '.', '.', '#', '.', '.', '.', '.', '.'],
['#', '.', '.', '.', '#', '#', '.', '.', '#', '.'],
['#', '#', '#', '#', '.', '#', '.', '.', '.', '#'],
['#', '#', '.', '#', '#', '.', '#', '#', '#', '.'],
['#', '#', '.', '.', '.', '#', '.', '#', '#', '#'],
['.', '#', '.', '#', '.', '#', '.', '.', '#', '#'],
['.', '.', '#', '.', '.', '.', '.', '#', '.', '.'],
['#', '#', '#', '.', '.', '.', '#', '.', '#', '.'],
['.', '.', '#', '#', '#', '.', '.', '#', '#', '#']], dtype='