1、列表中索引超出列表长度时,不会产生IndexError错误,而是输出 [] 。
2、给DataFrame的某一列进行赋值操作,遇到的警告
oof = df_train[['ID_code','target']] # type(df_train) ==> DataFrame
oof['predict'] = 0
oof["predict"][val_idx] = p_valid/N
warning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead。
See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy