Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
124 views
in Technique[技术] by (71.8m points)

Large binary list in a .data file in python

I'm a kind of noob of TensorFlow and python. I need to save a large list of binary element, into a .data file. I have tried with numpy.savetxt but the problem is the delimitator. The list is in this format:

[[ 0.  0.  1. ...  0.  0. 40.]
[ 0.  0.  0. ...  0.  0. 40.]
[ 1.  0.  0. ...  0.  0. 40.]
...
[ 0.  0.  1. ...  0.  0. 40.]
[ 0.  0.  0. ...  0.  0. 40.]
[ 0.  0.  0. ...  0.  0. 37.]]

And every element of the list is in this format:

[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.
0.  0.  0.  0.  1.  0.  0.  1.  5.  0.  0.  0.  1.  0.  0.  0.  0. 21.
0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  1.  0.  0. 40.]

How i can do this? If I use the "." or "," as a delimitator the result is terrible.

question from:https://stackoverflow.com/questions/65940557/large-binary-list-in-a-data-file-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...