I have some large csv files which I imported. I extracted some specific columns to create new matrix only with those columns. I used concatenate in order to place the columns next to each other. Now I would like to divide this matrix into two smaller ones by extracting some rows from it. I don't know why I keep getting the error when using pop function on the concatenated data.

```
data_set=[annual_inc, delinq_2yrs, dti, emp_length, loan_amnt, installment, int_rate, open_acc, total_acc, pub_rec, acc_now_delinq, loan_stat]

result=pd.concat(data_set,axis=1)

def splitDataSet(x, splitRatio):
    trainSize  = int(len(x)*splitRatio)
    trainSet=[]
    copy=x
    while len(trainSet)<trainSize:
        index=random.randrange(len(copy))
        trainSet.append(copy.pop(index))
    return[trainSet, copy]

splitRatio=0.67
train, test=splitDataSet(result, splitRatio)
print(train)

```

When I use pop on data\_set before it has been concatenated it works, but then it removes the respective column and it is not what I am looking for. For example after command

```
result.pop(0)

```

I get the error `'KeyError: 0'` I would simply like to remove row '0' from the array `result`

PS: I omitted the lines from the beginning like imports and some variable preprocessing. If someone needs it, I can paste it.