mercredi 2 juin 2021

Random sample n rows of pyspark dataframe

Is there ways to random sample n rows of pyspark dataframe by specifying the number of rows instead of sampling fraction? I only see tutorials on sampling a fraction of the rows online like the following links.

Select random rows from PySpark dataframe

Randomly Sample Pyspark dataframe with column conditions

Thanks!




Aucun commentaire:

Enregistrer un commentaire