Trailing zero #178
-
Dear Developers First of all, thanks very much for developing this very useful tool. I am currently using it for preparation of HEPData submission by converting txt files into yaml files. However, I encountered two related issues regarding trailing zeros.
In both cases, the number of significant figures is changed, which is not what I want. Is there any way I can avoid this? Thanks a lot for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Could you share minimal code example for this? I suspect there might be two independent issues here:
|
Beta Was this translation helpful? Give feedback.
-
I looked at the provided example. The |
Beta Was this translation helpful? Give feedback.
I looked at the provided example. The
numpy.loadtxt
function uses afloat
data-type by default. You can instead load the data as strings to preserve the original precision:data = np.loadtxt(fname, dtype=str)
. I checked that the YAML file written by the example script with this modification then preserves the trailing zeros of the original text file.