Jul-18-2020, 05:23 PM
I am trying to get a row count for a filtered data frame.
I have tried:
All of these return the count of rows for the entire data frame, not the count for the filtered results. How do I display the count for the remaining rows after filtration?
filt = (df['Type of breach']!='HACK') & (df['Description of incident'].str.contains('bank account', na=False) | df['Description of incident'].str.contains('social security number', na=False))I have tried:
df.count()
len (filt)
df.shapeAll of these return the count of rows for the entire data frame, not the count for the filtered results. How do I display the count for the remaining rows after filtration?