Imagine I have 2 data frames and they are from 2 databases. The 2 data frames should be exactly the same and they have both string and numbers. Is there a way to compare whether the 2 data frames are the same and list records that are different?
Imagine I have 2 data frames and they are from 2 databases. The 2 data frames should be exactly the same and they have both string and numbers. Is there a way to compare whether the 2 data frames are the same and list records that are different?
It is still not clear what input you have and what output you want. In my answer I assume you use DataFrames.jl and you want a list of rows that differ.
Assume that the data frames are df1 and df2.
df1 == df2 # if data frames do not have missing values in them
isequal(df1, df2) # if data frames do have missing values in them
(the reason for the difference is that Julia is in general missing-sensitive)
names(df1) == names(df2)
Bool vector of mismatched rows:.!=(eachrow(df1), eachrow(df2)) # no missings
.!isequal.(eachrow(df1), eachrow(df2)) # with missings
(there are other options than this one that might be faster, but this is simplest)