how to remove negetive value in nested list
You may never remove items form a list while iterating it, you'd keep the ones you need, the positive ones
y = [[col for col in row if col>=0] for row in y]
[[item for item in arr if item >= 0] for arr in y]