We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
这是怎么回事啊?
The text was updated successfully, but these errors were encountered:
Check data.shape。I got the same problem, then i found i was calling sample for an empty Dataframe。
data.shape
sample
Dataframe
Sorry, something went wrong.
No branches or pull requests
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
这是怎么回事啊?
The text was updated successfully, but these errors were encountered: