-
Notifications
You must be signed in to change notification settings - Fork 358
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
Implemented DataFrame.lookup #1785
base: master
Are you sure you want to change the base?
Conversation
Thanks, @HyukjinKwon |
Thanks, @ueshin |
raise ValueError("Row labels must have same size as column labels") | ||
lookups = [ | ||
self.loc[row_label, col_label] | ||
for row_label, col_label in zip(row_labels, col_labels) |
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.
Does this mean we launch jobs as many as labels?
databricks/koalas/frame.py
Outdated
@@ -10277,7 +10277,7 @@ def lookup(self, row_labels, col_labels) -> np.ndarray: | |||
lookups = [ | |||
self.loc[row_label, col_label] for row_label, col_label in zip(row_labels, col_labels) | |||
] | |||
return Series(lookups).to_numpy() | |||
return np.asarray(pd.Series(lookups)) |
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.
Out of curiosity, why did we change it to np.asarray(pd.Series(lookups))
?
This PR proposes
DataFrame.lookup
.