Hopefully a very simple solution to this. I have tried the solutions for two similar questions on SO, but these haven't worked for me.
Essentially I have a process which evaluates whether numbers in two columns of a dataframe are equal or not. For the vast majority this appears correct. However, in a very small number of cases, seemingly equal numbers are showing (to 6 decimal places) as not equal.
Clearly this is down to how my numbers are stored vs what I am seeing. But bizarrely, the data source of these numbers only stores them as 6dp, and trying to increase display.precision doesn't have any effect - I still only see 6dp.
a=df[df['Timestamp']=='2018-03-04 22:29:57']['Limit'].copy()
b=df[df['Timestamp']=='2018-03-04 22:29:57']['Quote'].copy()
pd.options.display.precision
Out[152]: 10
a
Out[153]:
15571027 25.850000
Name: Limit, dtype: float64
b
Out[154]:
15571027 25.850000
Name: Quote, dtype: float64
a==b
Out[155]:
15571027 False
dtype: bool
a-b
Out[156]:
15571027 -0.000000
dtype: float64
b>a
Out[157]:
15571027 True
dtype: bool
I am hoping some kind soul might be able to suggest the next logical steps I could try here - clearly b is greater than a, but 1) I cannot display this, and 2) I would ultimately like to create boolean comparisons which I know will be accurate to the same precision as I am displaying.
Many thanks in advance!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…