python 隨機打亂樣本

可以將列表隨機打亂 df=range(20)   1.python自帶的: return random.shuffle(li)  2. from sklearn.utils import shuffle   df = shuffle(df)   在Python裏面,使用Pandas裏面的DataFrame來存放數據的時候想要把數據集進行shuffle會許多的方法,本文介紹兩種比較常用而且簡單的方法
相關文章
相關標籤/搜索