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