Pandas – Random Sample of Columns
In this tutorial, we’ll cover how to get a random sample of columns of a pandas dataframe. The sample() function The pandas dataframe sample() function is generally used to sample rows from a dataframe. But you can also use it to sample columns by passing 1 or ‘columns’ to the axis parameter. The following is …