84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
比如删除以下DataFrame的后两列
0 1 2 0 1 0 1 1 0 0 1 2 1 0 1 3 0 0 1 4 0 0 1
我现在能想到的是
df.ix[:,~((df==1).all()|(df==0).all())]
显然,如果重复的数字是2、3、4、5....,那这么写就太麻烦了
ringa_lee
df.ix[:, (df != df.ix[0]).any()]
df.ix[:, (df != df.ix[0]).any()]