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

'a' must be greater than 0 unless no samples are taken #10

Open
Jameshu229 opened this issue Apr 3, 2019 · 1 comment
Open

'a' must be greater than 0 unless no samples are taken #10

Jameshu229 opened this issue Apr 3, 2019 · 1 comment

Comments

@Jameshu229
Copy link

In [22]:

15

data.sample(15)


ValueError Traceback (most recent call last)
in
----> 1 data.sample(15)

c:\users\administrator\appdata\local\programs\python\python37-32\lib\site-packages\pandas\core\generic.py in sample(self, n, frac, replace, weights, random_state, axis)
4863 "provide positive value.")
4864
-> 4865 locs = rs.choice(axis_length, size=n, replace=replace, p=weights)
4866 return self.take(locs, axis=axis, is_copy=False)
4867

mtrand.pyx in mtrand.RandomState.choice()

ValueError: 'a' must be greater than 0 unless no samples are taken

这是怎么回事啊?

@lsyarn
Copy link

lsyarn commented Sep 11, 2019

Check data.shape。I got the same problem, then i found i was calling sample for an empty Dataframe

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

No branches or pull requests

2 participants