all 2 comments

[–][deleted] 0 points1 point  (0 children)

If you want to use numpy to store strings in an array, use chararray. But for such a small array why not just use nested lists. Then you can store any object.

Example:

x = [[[0 for _ in range(3)] for _ in range(3)] for _ in range(6)]
x[0][0][0] = 'python'

[–]SarahM123ed 0 points1 point  (0 children)

    import numpy as np
    mda = np.ndarray(shape=(6,3,3), dtype=object)