-
Notifications
You must be signed in to change notification settings - Fork 367
Use pandas testing utils for exact cases. #1722
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
Conversation
|
Nice work! I'll revisit here after draft is finished |
|
cc @itholic can you review this? |
| self.assert_eq( | ||
| ks.get_dummies(kser, drop_first=True), | ||
| pd.get_dummies(pser, drop_first=True), | ||
| pd.get_dummies(pser, drop_first=True, dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May we don't need dtype=np.int8 here if we still use almost=True below ?
| self.assert_eq( | ||
| ks.get_dummies(kser, dummy_na=True), pd.get_dummies(pser, dummy_na=True), almost=True | ||
| ks.get_dummies(kser, dummy_na=True), | ||
| pd.get_dummies(pser, dummy_na=True, dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto ?
itholic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or it would be okay to leave it as it is, considering fixing it later.
| kdf = ks.from_pandas(pdf) | ||
|
|
||
| self.assert_eq(ks.get_dummies(kdf), pd.get_dummies(pdf), almost=True) | ||
| self.assert_eq(ks.get_dummies(kdf), pd.get_dummies(pdf, dtype=np.int8), almost=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those all same.. maybe
| self.assert_eq( | ||
| ks.get_dummies(kdf, columns=[("y", "c", "3"), ("x", "a", "1")]), | ||
| pd.get_dummies(pdf, columns=[("y", "c", "3"), ("x", "a", "1")]), | ||
| pd.get_dummies(pdf, columns=[("y", "c", "3"), ("x", "a", "1")], dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| self.assert_eq( | ||
| ks.get_dummies(kdf, columns=["x"]), pd.get_dummies(pdf, columns=["x"]), almost=True | ||
| ks.get_dummies(kdf, columns=["x"]), | ||
| pd.get_dummies(pdf, columns=["x"], dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| self.assert_eq( | ||
| ks.get_dummies(kdf, columns=("x", "a")), | ||
| pd.get_dummies(pdf, columns=("x", "a")), | ||
| pd.get_dummies(pdf, columns=("x", "a"), dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| self.assert_eq( | ||
| ks.get_dummies(kdf, columns=["x"]), pd.get_dummies(pdf, columns=["x"]), almost=True | ||
| ks.get_dummies(kdf, columns=["x"]), | ||
| pd.get_dummies(pdf, columns=["x"], dtype=np.int8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
Otherwise, LGTM ! |
|
For the |
|
Thanks! I'd merge this now. Please feel free to leave comments if any. |
Original PR #1722 by ueshin Original: databricks/koalas#1722
Merged from original PR #1722 Original: databricks/koalas#1722
Original PR #1722 by ueshin Original: databricks/koalas#1722
Merged from original PR #1722 Original: databricks/koalas#1722
Changes the testing infrastructure for exact cases to pandas' testing library.