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

Support md.get_dummies() #2323

Merged
merged 5 commits into from
Oct 19, 2021
Merged

Support md.get_dummies() #2323

merged 5 commits into from
Oct 19, 2021

Conversation

hoarjour
Copy link
Contributor

@hoarjour hoarjour commented Aug 10, 2021

What do these changes do?

This PR added support for DataFrame.get_dummies().

Related issue number

Resolves #570

@qinxuye qinxuye added mod: dataframe to be backported Indicate that the PR need to be backported to stable branch type: feature New feature labels Aug 11, 2021
@qinxuye qinxuye added this to the v0.8.0a2 milestone Aug 11, 2021
@wjsi
Copy link
Member

wjsi commented Aug 20, 2021

A simple test below failed:

df = md.DataFrame(mt.random.choice(['a', 'b', 'c'], (100, 2), chunk_size=10))
# Length of 'prefix' (3) did not match the length of the columns being encoded (0)
md.get_dummies(df, prefix=['col1', 'col2']).execute()

while it works in pandas:

df = pd.DataFrame(np.random.choice(['a', 'b', 'c'], (100, 2)))
pd.get_dummies(df, prefix=['col1', 'col2'])

@qinxuye qinxuye modified the milestones: v0.8.0a2, v0.8.0a3 Aug 23, 2021
@qinxuye qinxuye modified the milestones: v0.8.0a3, v0.8.0b1 Sep 3, 2021
@hekaisheng
Copy link
Contributor

Seems test_transpose_execution was removed when merge the master.

@qinxuye qinxuye modified the milestones: v0.8.0b1, v0.8.0b2 Sep 21, 2021
Copy link
Contributor

@hekaisheng hekaisheng left a comment

Choose a reason for hiding this comment

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

The tile logic seems not be efficient for me, there is still room for improvement.

mars/dataframe/base/get_dummies.py Outdated Show resolved Hide resolved
mars/dataframe/base/get_dummies.py Show resolved Hide resolved
mars/dataframe/base/get_dummies.py Show resolved Hide resolved
@qinxuye qinxuye modified the milestones: v0.8.0b2, v0.8.0rc1 Oct 9, 2021
Copy link
Contributor

@hekaisheng hekaisheng left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@wjsi wjsi left a comment

Choose a reason for hiding this comment

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

LGTM

@wjsi wjsi merged commit 19dcd80 into mars-project:master Oct 19, 2021
wjsi pushed a commit to wjsi/mars that referenced this pull request Oct 19, 2021
Co-authored-by: hekaisheng <kaisheng.hks@alibaba-inc.com>
qinxuye pushed a commit that referenced this pull request Oct 19, 2021
@qinxuye qinxuye added backported already PR has been backported and removed to be backported Indicate that the PR need to be backported to stable branch labels Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement get_dummies interface for Series or DataFrame
4 participants