Discover all of the brand-new features and improvements to existing capabilities in the Dataiku 11.3 updateLET'S GO

Float64 failing to write/read?

Dryopes
Level 1
Float64 failing to write/read?

Hi,

I am working with a database with plenty of float64 operations, and I have trouble comparing these floats which each other when reading/writing from the database. A simple example of this is as follows:

import dataiku
import pandas as pd

df = pd.DataFrame(data = {'a' : [3222.232343243847737]})
db = dataiku.Dataset("test")

db.write_with_schema(df)
df2 = db.get_dataframe()

print(df.values[0][0] == df2.values[0][0])

 

1 rows successfully written (L26vwn5Fzw)
False

 

Here it seems that the floating value seem to change in the process of reading/writing the database. Am I doing something wrong, is this expected behavior?

0 Kudos
1 Reply
tgb417

@Dryopes ,

Welcome to the Dataiku Community, glad to have you here.

A while back I ran into something similar.  Not clear if it will be your problem or not. 

What was explained to me was a binary encoding rounding error. But I think in my example I had a division. 

See  if you put a round() function around things out to say 15 places if the problem resolves.

That said I’d also encourage you to put in a support ticket. If you have found a defect it would be great to get this in the backlog with the development team. 

Here is a somewhat longer discussion on this topic. https://community.dataiku.com/t5/General-Discussion/Precision-on-Mathematical-formulas-on-a-recipe/t... 

--Tom