Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should we add is_equal to checks for frames comparison (the way we want it) ? #97

Open
sergpolly opened this issue Sep 17, 2021 · 1 comment
Labels

Comments

@sergpolly
Copy link
Member

as silly as it might sound - we might benefit from a tiny function that checks if 2 bedframes are identical ...
it turns out that pandas.DataFrame.equals method is rather strict, and not only it requires a pair of dataframes to have identical values (obviously), identical shapes etc, - but it also requires them to have identical dtypes - which is a bit of a pain, as some of the bioframe methods alter types of start, end columns from int32/64 to pandas.Int64Dtype

so we could have something like that the library:

bioframe.is_equal_OR_equal_intervals_OR_something_like_that(
    df1,
    df2,
    check_dtypes=False, 
    compare_coordinates_only=True, # compare chrom,start,end and ignore other columns ...
    cols1=None,
    cols2=None
    common_dtypes = {?}
    # what else ?
)

where we can make sure a pair of frames with "acceptable" differences (different names of chrom,start,end, presence of extra columns, dtypes differences, etc), can be recognized as "identical"

@gfudenberg
Copy link
Member

were you thinking to check if the set of intervals are the same irrespective of order? ignoring or preserving duplicates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants