The
take_any
function is a random row generator. Based on the parameters passed it, it will select a random row from the dataset being piped into it. It also has a variant,take_anyif
, we’ll see both in this post.Note that
take_any
was originally calledany
and was renamed. Whileany
still works, it has been deprecated and you should now usetake_any
.
As always, Robert shares plenty of examples of how the operator works, so check it out.