def dump(filename):
def wrapper(df):
df.to_parquet(filename)
return df
return wrapper
And so on! If you didn't use .pipe before, give it a try, it's nice!
def dump(filename):
def wrapper(df):
df.to_parquet(filename)
return df
return wrapper
And so on! If you didn't use .pipe before, give it a try, it's nice!
def assrt(condition):
def wrapper(df):
assert condition(df)
return df
return wrapper
and use this function with a .pipe method:
df.assign(…).query(…).pipe(assrt(lambda _: not _['column'].isna().any())).groupby(…)…
def assrt(condition):
def wrapper(df):
assert condition(df)
return df
return wrapper
and use this function with a .pipe method:
df.assign(…).query(…).pipe(assrt(lambda _: not _['column'].isna().any())).groupby(…)…