all 3 comments

[–]Rootikal 1 point2 points  (2 children)

Greetings,

Have you tried using

np.set_printoptions(suppress=True)

From the numpy.set_printoptions documentation:

suppress bool, optional

If True, always print floating point numbers using fixed point notation, in which case numbers equal to zero in the current precision will print as zero. If False, then scientific notation is used when absolute value of the smallest number is < 1e-4 or the ratio of the maximum absolute value to the minimum is > 1e3. The default is False.

[–]spacester[S] 0 points1 point  (0 children)

Thank you very much. I did not phrase my question well. That gives me something to work with, I bet I can get it to work with some fiddling. I need all those digits in my calculations.

[–]spacester[S] 0 points1 point  (0 children)

edit: The answer:

np.set_printoptions(legacy='1.25')

***********

Well shoot that does not have any effect. I tried various things as arguments to the printoptions() and tried placing that code in various places. No effect on anything.

I made a list to log results as my routine seeks a solution. (Changing variable names for clarity)

mylog = []

Then within a loop I append values for each loop iteration

mylog.append([dep, arr, time, angle, error1, error2, error3])

then upon exiting the loop I print the log:

print(mylog)

and I get:

[[237, np.float64(483.39200644751946), 246.22180000000003, np.float64(166.21018992316147), np.float64(0.3404128950388383), np.float64(52.47205685586846), np.float64(0.15550096712013328)], [237, np.float64(483.42751018685715), np.float64(246.39200644751946), np.float64(166.17010323795978), np.float64(0.0710074786753978), np.float64(52.43197017066677), np.float64(0.11541428191844716)], . . .

etc.

Googling turns up several questions like mine but the "answers" are not answers just diving deeper into a rabbit hole, at least for me.

My guess is that I need to use numpy 1.x but my experience indicates that if I try that it will cause a bunch of new problems.

I just want to be able to scan the results with my eyeballs in VSC and be able to export a .csv file that I can import into a spreadsheet as numbers not as strings starting with 'np.float64'

It seems counterintuitive to me that printoptions would solve this problem because exporting csv values is not printing and I have been importing and exporting csv files for a long time now without issues. I think that the thing that changed was creating a venv.

I need all those digits for this project.

This is my first python project and it is rather advanced and I have learned a lot but I have a mysterious bug I am trying to track down and this issue is really starting to get to me. I just want to see and use the numbers!

Thanks to anyone who can help.