Background:
The following function takes a pandas DataFrame and renames it exceptions_df whilst applying 2x conditions to it.
Function:
def ownership_exception_report():
df = ownership_qc()
exceptions_df = df[df['Entity ID %'] != 100.00]
exceptions_df = df[df['Account # %'] != 100.00]
return exceptions_df
My problem:
Whilst my code works fine, I wonder if there is a simple and more eloquent way to apply 2x conditions to a DataFrame and resave it? At the moment I am simply resaving the exceptions_df twice and it seems rather messy. Or perhaps I am wrong, and this is the correct way to apply conditions to a DataFrame?