df.concat(train,test)
Help · 15 Sep 2020, 09:24 · 4

please after performing this concatenation i encountered Null values in my target column. how do I handle this?

Discussion 4 answers
User avatar
University of benin

Bear with me, but I don't think you are meant to concatenate the datasets.

15 Sep 2020, 09:42
Upvotes 0

You can work with the train and test dataset separately but I want to perform Feature Eng on the dataset together, reasons why I concatenated.

Try using df = pd.concat([train, test]).reset_index(drop = True)

15 Sep 2020, 09:57
Upvotes 0

Yeah use this:

train['source']='train'

test['source']='test'

data = pd.concat([train, test],ignore_index=True) print (train.shape, test.shape, data.shape)