Skip to content
Advertisement

Python Pandas Filter but results are inversed

Hi I’ve built a filter where I expect the results to only show ‘New’. However the result shows everything but new?

filt = (export['jiraStatus'] == 'New')
print(export.loc[~filt])

Thoughts?

TIA

Neil

Advertisement

Answer

The ~ negates/inverts the filter. Just use .loc[filt] instead of .loc[~filt] to get the un-negated result.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement