Closed wukan1986 closed 5 months ago
Thanks for raising this - let me cover the corner case of no valid data gracefully. I will let you know once this is fixed
Hi @wukan1986
This should be fixed in latest commit https://github.com/azmyrajab/polars_ols/commit/567ab2d1176dbd3f965f41dec8366cf008290816, specifically 304 of expressions.rs. Will release a new version shortly once CI tests clear.
This test should now pass -
def test_all_empty_data():
df = pl.DataFrame(
{
"A": [None, 2, None, 4],
"B": [1, None, 3, None],
}
)
df = df.with_columns(
pl.col("A")
.least_squares.ols(
pl.col("B"),
mode="residuals",
null_policy="drop",
solve_method="svd",
)
.alias("residuals")
)
assert df["residuals"].is_null().all()
should be resolved now
Thank you very much
My data quality is not very good, and there may be all null
I hope the resid is