Onlyy columns are visible after spliiting the combined data set back into train and test!



Hello all!!!
Used the following code to split data{combined dataset} into train and test again. But after doing so no row values are as such visible , rather only columns are visible.
Please help me out!!!
#Divide into test and train:
train = data.loc[data[‘source’]==“train”]
test = data.loc[data[‘source’]==“test”]


Hi @sahil1995chaturvedi,

The following code is working for me:

train= pd.read_csv("~/train.csv")

test= pd.read_csv("~/test.csv")



Combine train and test dataset:

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

Divide into test and train:

train = data.loc[black[‘source’]==“train”]
test = data.loc[black[‘source’]==“test”]


Actually I made a typo of “Train” instead of ‘train’ in the original code.
Btw Thanks for your help brother!!!