I have seen many questions concerning the filtering of a pandas data frame with millions of rows. However, I have a specific requirement of filtering my data frame with 60000 columns.
As seen in the image below, the shape is 25000 rows by 57827 columns. I want to filter the data frame based on the column "Label", which has only values 1 and 0.
Normally, it should work when I do the below:
negative_review= Train_clean[Train_clean['label'] == "0"]
positive_review = Train_clean[Train_clean['label'] == "1"]
However, I run out of memory and the kernel dies. The only conclusion I could derive is due to the presence of a huge number of columns.
I found only one question in SO similar to mine but it does not solve my problem: link to question
Please provide me with some guidance