1
我有一個numpy數組,我想排序行。排序一個numpy數組
>>f1
array([['b', '3'],
['v', '7'],
['a', '1'],
['a', '0'],
['a', '5'],
['f', '7'],
['f', '5'],
['a', '2'], dtype=object)
我使用排序()和我越來越喜歡這個
>> f1.sort()
>> print f1
[['3' 'b']
['7' 'v']
['1' 'a']
['0' 'a']
['5' 'a']
['7' 'f']
['5' 'f']
['2' 'a']]
但我需要的是,
[['a' '0']
['a' '1']
['a' '2']
['a' '5']
['b' '3']
['f' '5']
['f' '7']
['v' '7']]
有人可以幫助我
如何,我們有'[ 'A' '7']'在O/p? – Divakar