I have a data frame where I have a column with nan values
I filtered them:
X_train = data[np.isnan(data[column]) == False].drop(column, 1)
y_train = data[np.isnan(data[column]) == False][column]
X_test = data[np.isnan(data[column]) == True].drop(column, 1)
y_test = data[np.isnan(data[column]) == True][column]
Then with some complex algorithm I predict y_test values. And then I want to merge these DataFrames with correct order. For example:
X, y
1, 1
12, nan
2, 3
5, nan
7, 34
y_test will have 2 values. For example after algorith is ended y_test == [2, 43]
Then I want to create following DataFrame:
X, y
1, 1
12, 2
2, 3
5, 43
7, 34