How do I capture all complying values using a mask in Pandas?

84 views Asked by At

Value_counts performed in one specific data frame column shows visually that there are 441 values lower than 10. When I run a mask (boolean indexing) in order to access those values it only gets 12 of the 441.

I thought it was a datatype issue. However, right before the operations above I changed the column data type to float using the astype function. There should not be an issue with data type.

1

There are 1 answers

0
Manuel A. Albornoz On

I used the function astype(float) all along for masking and value_counts operations. This catches all the numeric values complying the filter and not only a few str values present in the data.