2021年4月6日星期二

Splitting by indices: I want to split the train + test from the data whose indices have been given. How shall I get train/test df?

for example= df is the data with features. I want to split the train + test from the data whose indices have been given. How shall I get train/test df.

df=  0 2 0.3 0.5 0.5  1 4 0.5 0.7 0.4  2 2 0.5 0.1 0.4  3 4 0.4 0.1 0.3  4 2 0.3 0.1 0.5    where train.txt is   train=pd.read_csv(data_train.txt)  where in this dataframe indices are given. How should I get the training data from those indices?     Contents in data_train.txt(there are 10000 of data in which train indices are given in this txt file)  0  2  4  I want these indices for training data with feature:- like    final train should look like thi**s(see the index)**:-  0 2 0.3 0.5 0.5  2 2 0.5 0.1 0.4  4 2 0.3 0.1 0.5  
https://stackoverflow.com/questions/66977794/splitting-by-indices-i-want-to-split-the-train-test-from-the-data-whose-indic April 07, 2021 at 07:35AM

没有评论:

发表评论