pandas sample函数
使用pd.sample()随机选取N行数据
df.sample(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)
输入参数见下表所示:



在df.sample()函数中设置frac=1.0时可以实现shuffle

另外一种shffule方法

df.sample(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)
输入参数见下表所示:




