I have a function defined like this:
def demand_cleaning(df=None, location, output,_input,tables):
And I would like to test if df
was passed or not (df
is a pandas DataFrame
)
If df
is not passed I want to do something like
if df is None:
df = pd.read_pickle(tables + "Demand Raw")
But this test does not work now. and I get this
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Something like this would do: