I have a dataframe and I need to make filter all line which are not “qty”
df = pl.DataFrame({
'doc_n': ['1111', '2222', '3333'],
'received': ['qty', '6.0', None],
})
When I tried to filter it, I receved only line ‘2222’, Polars removed line with ‘null’ as well. But I need to leave it in my df
”’
df = df.filter(pl.col(‘received’) != ‘qty’)
”’
How can I filter it correctly? After filter I should have 2 lines in df (6.0 and null)
New contributor
Masik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.