1
我想將下面的列表更改爲2d數組。列表/數組形狀經常讓我困惑,我希望數據的格式爲y = 14.96,22.17,...和x = 15.25,25.36,... final_array = [x,y],那麼它會更容易繪圖。重塑Python中的附加列表 - 將列表拆分爲列
[[14.96786030991488, 15.26],
[22.170739257927302, 25.366999999999997],
[32.07129009546086, 39.536000000000001],
[53.91092877753442, 59.655000000000001],
[90.1398030963187, 89.387],
[117.33864311518501, 119.70999999999999],
[123.99886910884739, 155.13999999999999],
[220.35978335270883, 241.97],
[246.1408069941774, 281.25],
[275.5098457739598, 312.33999999999997],
[326.2608566528128, 365.13],
[399.24680126783164, 415.20999999999998]]
嘗試這種至今:
np.reshape(mean_plain,[12,2])
這裏是我如何創建它 http://stackoverflow.com/questions/33098768/array-summation-calculating-mean-of – WBM
類似於[[item [0] for my_list中的項目],[item [1 ]爲my_list中的項目]]'? – njzk2
或實際上只是'zip(* my_list)' – njzk2