DataFrame k-fold

在根据row,通过data.iloc[:] 来切分数据时,其中的index不会改变,如果我们在之后的数据中使用index,就会遇到不连续的情况;

 

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.reset_index.html

所以这里要使用 

df.reset_index(drop=True)

 

 

posted @ 2020-10-16 14:03  ChevisZhang  阅读(186)  评论(0编辑  收藏  举报