In the documentation found here, the line print row_set.sample.next() throws an error.
This is due to a syntax change for iterators in Python 3.x. See this question for more details.
The documentation can be changed to row_set.sample.__next__() or next(row_set.sample).