You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have sign() which is the same as numpy.sign, in that it converts 0.0 and -0.0 to 0.0. In the absence of copysign I failed to find any tools to differentiate 0.0 and -0.0, unless I take that series and call numpy.copysign on it. Can we have expr.copysign(expr) so that I can polars.lit(1).copysign(polars.col("c"))?
The text was updated successfully, but these errors were encountered:
These values may be parsed from feather/parquet/whatever; in an IPC application using arrow streaming format, if this sign bit can be used to mark two different cases, I can drop a boolean column and thus reduce memory usage and/or IO transfers. I agree that's not a good design, and it isn't usually useful but IMO it doesn't hurt to include it?
I don't think that's a good enough reason, sorry. And as mentioned before, we don't actually respect the sign bit for zeroes/NaNs in Polars and may drop it arbitrarily, so your idea wouldn't work robustly in Polars either.
Description
Currently we have
sign()
which is the same asnumpy.sign
, in that it converts 0.0 and -0.0 to 0.0. In the absence ofcopysign
I failed to find any tools to differentiate 0.0 and -0.0, unless I take that series and callnumpy.copysign
on it. Can we haveexpr.copysign(expr)
so that I canpolars.lit(1).copysign(polars.col("c"))
?The text was updated successfully, but these errors were encountered: