Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有一个 dtype 字符串的 numpy ndarray:
from numpy import array as narray a = narray(['a', 'b'])
如何向其中添加另一个字符串?以及如何通过索引访问该字符串?
查看http://docs.scipy.org/doc/numpy/reference/generated/numpy.insert.html
例如,
numpy.insert( a, 2, 'c' )
将插入c.a
c
a