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
if (valueisnotNoneandvalue==valueandmethodisNoneand
The value == value looks suspicious. It is there either by mistake or one was trying to check whether the value is float or not since as far as I know, the Boolean value of the comparison will always be the same, unless the value is the floating point value float('nan').
If the latter, then there is a better way to do it with the cmath.isinf(value) and not cmath.isnan(value) to be explicit in the intention. However, maybe there is some bug in numpy or similar that you are trying to work around? @rockg@jreback
I wanted to check with core developers before submitting a PR.
The text was updated successfully, but these errors were encountered:
LGTM.com code analysis website found an interesting issue of comparison of identical values:
https://lgtm.com/projects/g/pandas-dev/pandas/snapshot/fe32cc08cf2e4dbdfa4aad33f3a74fada201600f/files/pandas/core/sparse/frame.py?sort=name&dir=ASC&mode=heatmap#L340
The line
pandas/pandas/core/sparse/frame.py
Line 340 in 429078b
The
value == value
looks suspicious. It is there either by mistake or one was trying to check whether the value is float or not since as far as I know, the Boolean value of the comparison will always be the same, unless the value is the floating point valuefloat('nan')
.If the latter, then there is a better way to do it with the
cmath.isinf(value) and not cmath.isnan(value)
to be explicit in the intention. However, maybe there is some bug innumpy
or similar that you are trying to work around? @rockg @jrebackI wanted to check with core developers before submitting a PR.
The text was updated successfully, but these errors were encountered: