I want to use a boolean to select columns with more than 4000 entries in a comb that has more than 1000 columns. This expression gives me a logical (True / False) result:
criteria = comb.ix[:,'c_0327':].count()>4000
I want to use it to select only True columns for a new Dataframe.
The following just gives me the “Fatal Boolean Series Key”:
comb.loc[criteria,]
I also tried:
comb.ix[:, comb.ix[:,'c_0327':].count()>4000]
As in this question, the answer is Boolean selection of data in the frame by columns rather than rows, but the same error occurs: "An unchangeable logical key of the series is provided"
comb.ix[:,'c_0327':].count()>4000
outputs:
c_0327 False c_0328 False c_0329 False c_0330 False c_0331 False c_0332 False c_0333 False c_0334 False c_0335 False c_0336 False c_0337 True c_0338 False .....
source share