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

PandasLikeDataFrame: Add sample() #48

Closed
wants to merge 1 commit into from
Closed

PandasLikeDataFrame: Add sample() #48

wants to merge 1 commit into from

Conversation

AbdealiLoKo
Copy link
Contributor

Mimic the pandas sample() functionality for spark.

@AbdealiLoKo AbdealiLoKo mentioned this pull request Mar 29, 2019
Mimic the pandas sample() functionality for spark.
Copy link
Collaborator

@garawalid garawalid left a comment

Choose a reason for hiding this comment

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

I have a small comment and I suggest that you add a test for sample().

I think also, we can move sample() to generic.py because the method is the same for both Series and DataFrame

@@ -588,6 +588,24 @@ def pipe(self, func, *args, **kwargs):
def shape(self):
return len(self), len(self.columns)

def sample(self, n=None, frac=None, replace=False, random_state=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to add the same parameters as Pandas. And, we raise a NotImplementedError.

def(self, n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)

@HyukjinKwon
Copy link
Member

sorry for delay, @AbdealiJK, can you rebase this? let me take a look and be responsive.

@rxin
Copy link
Contributor

rxin commented May 15, 2019

I'm closing this one. Will continue the work in #327

@rxin rxin closed this May 15, 2019
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.

None yet

4 participants