RokoMijic
RokoMijic
Any progress on this?
I have written a function for my own use to solve this problem: ``` def justif_prec(uf: ufloat) -> str: return ('{0:.' + str( max(1,math.floor( -np.log10( max(1e-9,uf.std_dev) ) )) ) +...
As for why I feel this function is required: ``` def sample_from(uf,ns) : return list(np.random.normal(uf.nominal_value, uf.std_dev, ns)) ['{0:.1f}'.format(s) for s in sample_from(myrand,8 )] ``` > ['3.6', '3.6', '3.6', '3.6', '3.6',...
As a further example: ``` baseline_result = ufloat(8.66448136457,0.0353459) result_with_new_feature = ufloat(8.671507820,0.035175) print(baseline_result) ``` > 8.664+/-0.035 `print(result_with_new_feature)` > 8.672+/-0.035 Trap: "Seems like a small improvement. It changed two digits" Reality: "I...
@lebigot Well, the code is correct for it's purpose: to work out the probability in that particular case (not in general).
But the use-case I have in mind is basically getting more people to do data science with the IMO excellent uncertainties module you have here. One key sticking point I...
regarding printing, latex and formatting: yes, I realise that that's going to be complicated. It may be possible to sidestep that by just supplying a method called .jp or something...
regarding this: > Add a formatting option that requests to not print the uncertainty, but to print the nominal part. It doesn't really seem to get at the problem here...
Right, it isn't possible using conventional decimal notation to display only the correct digits (correct with some probability). Can you point me to the documentation for exactly what .1u does...
Python 3 would definitely be good.