标签:style nump ram frame and sam pre panda 抽样
import numpy as np import pandas as pd df=pd.DataFrame(np.arange(25).reshape(5,5)) new_order=np.random.permutation(5)#不暗中哦顺序排列 print(df.take(new_order))#take改变索引 sample=np.random.randint(0,len(df),size=2) print(df.take(sample))#随机抽样
标签:style nump ram frame and sam pre panda 抽样
原文地址:https://www.cnblogs.com/wcyMiracle/p/12447940.html