擅长:python、mysql、java
<p>试试这个:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
animal = np.empty((0, 3), str)
mammal = ["monkey","dog","cat"]
amphibian = ["frog","toad","salamanders"]
aquatic = ["fish","eel","whale"]
x = [mammal, amphibian, aquatic]
for i in x:
animal = np.append(animal, np.array([i]), axis=0)
print(animal)
</code></pre>
<p>输出:</p>
<pre><code>array([['monkey', 'dog', 'cat'],
['frog', 'toad', 'salamanders'],
['fish', 'eel', 'whale']], dtype='<U11')
</code></pre>