As following my previous question. I now have a ndarray with the form:
[[ 0. ]
[ 18.21545873]
[ 14.93752607]
[ 15.55222205]
[ 14.93752607]
[ 10.68406032]
[ 11.54598659]
[ 15.55222205]
[ 11.54598659]
[ 12.30302814]]
- How do I sort this array? Since it is not a normal list. It is a ndarray, in other words, it is a list of lists.
Is normal that people sort this list of lists directly, or people usually change it to a normal list
[ 0. , 18.21545873, 14.93752607, 15.55222205, 14.93752607, 10.68406032, 11.54598659, 15.55222205, 11.54598659, 12.30302814]
and then sort this list?
Many thanks!
0. See here stackoverflow.com/a/2828371/2296458numpyArray, you just saynewList = list(numpyArray)newList = list(numpyArray), isarray([0.]), array([18.21545873]), .... But what I meant is[0., 18.21545873, ...]. Do I need to open another question for this?x, try this:[i for i in x[:,0]]