|
|
@@ -5,46 +5,46 @@ import pandas as pd
|
|
|
import numpy as np
|
|
|
|
|
|
def format(mean, std):
|
|
|
- if std >= 1000:
|
|
|
- m = int(round(mean/1000.0)) * 1000
|
|
|
- s = int(round(std/1000.0)) * 1000
|
|
|
+ if std >= 950:
|
|
|
+ m = round(mean/1000.0) * 1000
|
|
|
+ s = round(std/1000.0) * 1000
|
|
|
dec = 0
|
|
|
- elif std >= 100:
|
|
|
- m = int(round(mean/100.0)) * 100
|
|
|
- s = int(round(std/100.0)) * 100
|
|
|
+ elif std >= 95:
|
|
|
+ m = round(mean/100.0) * 100
|
|
|
+ s = round(std/100.0) * 100
|
|
|
dec = 0
|
|
|
- elif std >= 10:
|
|
|
- m = int(round(mean/10.0)) * 10
|
|
|
- s = int(round(std/10.0)) * 10
|
|
|
+ elif std >= 9.5:
|
|
|
+ m = round(mean/10.0) * 10
|
|
|
+ s = round(std/10.0) * 10
|
|
|
dec = 0
|
|
|
- elif std >= 1.0:
|
|
|
- m = int(round(mean))
|
|
|
- s = int(round(std))
|
|
|
+ elif std >= 0.95:
|
|
|
+ m = round(mean)
|
|
|
+ s = round(std)
|
|
|
dec = 0
|
|
|
- elif std >= 0.1:
|
|
|
- m = int(round(mean*10)) / 10.0
|
|
|
- s = int(round(std*10)) / 10.0
|
|
|
+ elif std >= 0.095:
|
|
|
+ m = round(mean*10) / 10.0
|
|
|
+ s = round(std*10) / 10.0
|
|
|
dec = 1
|
|
|
- elif std >= 0.01:
|
|
|
- m = int(round(mean*100)) / 100.0
|
|
|
- s = int(round(std*100)) / 100.0
|
|
|
+ elif std >= 0.0095:
|
|
|
+ m = round(mean*100) / 100.0
|
|
|
+ s = round(std*100) / 100.0
|
|
|
dec = 2
|
|
|
- elif std >= 0.001:
|
|
|
- m = int(round(mean*1000)) / 1000.0
|
|
|
- s = int(round(std*1000)) / 1000.0
|
|
|
+ elif std >= 0.00095:
|
|
|
+ m = round(mean*1000) / 1000.0
|
|
|
+ s = round(std*1000) / 1000.0
|
|
|
dec = 3
|
|
|
- elif std >= 0.0001:
|
|
|
- m = int(round(mean*10000)) / 10000.0
|
|
|
- s = int(round(std*10000)) / 10000.0
|
|
|
+ elif std >= 0.000095:
|
|
|
+ m = round(mean*10000) / 10000.0
|
|
|
+ s = round(std*10000) / 10000.0
|
|
|
dec = 4
|
|
|
- elif std >= 0.00001:
|
|
|
- m = int(round(mean*100000)) / 100000.0
|
|
|
- s = int(round(std*100000)) / 100000.0
|
|
|
+ elif std >= 0.0000095:
|
|
|
+ m = round(mean*100000) / 100000.0
|
|
|
+ s = round(std*100000) / 100000.0
|
|
|
dec = 5
|
|
|
# We measure in ns; if std == 0, this is the case to use
|
|
|
else:
|
|
|
- m = int(round(mean*1000000)) / 1000000.0
|
|
|
- s = int(round(std*1000000)) / 1000000.0
|
|
|
+ m = round(mean*1000000) / 1000000.0
|
|
|
+ s = round(std*1000000) / 1000000.0
|
|
|
dec = 6
|
|
|
m = str(m)
|
|
|
s = str(s)
|