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

Implement Index/MultiIndex.equals #1216

Merged
merged 2 commits into from
Jan 23, 2020

Conversation

HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 23, 2020

import databricks.koalas as ks
idx = ks.Index(['a', 'b', 'c'])
midx = ks.MultiIndex.from_tuples([('a', 'x'), ('b', 'y'), ('c', 'z')])
idx.equals(idx)
midx.equals(idx)
from databricks.koalas.config import option_context
with option_context('compute.ops_on_diff_frames', True):
    idx.equals(ks.Index(['a', 'b', 'c']))

@codecov-io
Copy link

codecov-io commented Jan 23, 2020

Codecov Report

Merging #1216 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1216      +/-   ##
==========================================
- Coverage   95.21%   95.21%   -0.01%     
==========================================
  Files          35       35              
  Lines        7254     7252       -2     
==========================================
- Hits         6907     6905       -2     
  Misses        347      347
Impacted Files Coverage Δ
databricks/koalas/missing/indexes.py 100% <ø> (ø) ⬆️
databricks/koalas/indexes.py 96% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 075b92b...993ba64. Read the comment docs.

@HyukjinKwon HyukjinKwon merged commit 5ac56ed into databricks:master Jan 23, 2020
@HyukjinKwon
Copy link
Member Author

I am merging this for today's release.

For Index

>>> idx.equals(idx)
False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this False? Also, for identical?

>>> import pandas as pd
>>> idx = pd.Index(['a', 'b', 'c'])
>>> idx.equals(idx)
True
>>> idx.identical(idx)
True

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Submitted a PR #1220.

For MultiIndex

>>> midx.equals(midx)
False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

>>> midx = pd.MultiIndex.from_tuples([('a', 'x'), ('b', 'y'), ('c', 'z')])
>>> midx.names = ("nameA", "nameB")
>>> midx.equals(midx)
True
>>> midx.identical(midx)
True

@HyukjinKwon HyukjinKwon deleted the index-equals branch September 11, 2020 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants