SyntaxFix
Write A Post
Hire A Developer
Questions
Something like this?
import random def some(x, n): return x.ix[random.sample(x.index, n)]
Note: As of Pandas v0.20.0, ix has been deprecated in favour of loc for label based indexing.
ix
loc