qq_19340683
qq_19340683
2018-05-02 09:18

求助大神,numy ndarray转为list

5
  • python

网上搜了很多 tolist会将ndarry转成一行 而不是逗号隔开的行 ,求助大神
[[0.02407997 0.0230331 0.02451023 ... 0.02099599 0.02108407 0.02127302]
[0.02408507 0.0229293 0.0220789 ... 0.02095065 0.02102397 0.02120139]
[0.02436025 0.02317223 0.02230555 ... 0.02115807 0.02124699 0.02143753]
...
[0.02267 0.02292304 0.02246058 ... 0.0210516 0.02107221 0.02120132]
[0.02299755 0.02345366 0.02326958 ... 0.0211791 0.02126773 0.02145817]
[0.02459634 0.02318546 0.02258372 ... 0.02113681 0.02122526 0.02141533]]

想转换成

[[0.02407997 0.0230331 0.02451023 ... 0.02099599 0.02108407 0.02127302],
[0.02408507 0.0229293 0.0220789 ... 0.02095065 0.02102397 0.02120139],
[0.02436025 0.02317223 0.02230555 ... 0.02115807 0.02124699 0.02143753],
...
[0.02267 0.02292304 0.02246058 ... 0.0210516 0.02107221 0.02120132],
[0.02299755 0.02345366 0.02326958 ... 0.0211791 0.02126773 0.02145817],
[0.02459634 0.02318546 0.02258372 ... 0.02113681 0.02122526 0.02141533]]

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答