We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Series looks to be coerced to float if the result contains NaN or inf. Otherwise Index doesn't. Make it to be consistent in either way.
Series
float
NaN
inf
Index
pd.Series([1]) // pd.Series([0]) #0 inf # dtype: float64 pd.Index([1]) // pd.Index([0]) # Int64Index([0], dtype='int64') np.array([1]) // np.array([0]) # array([0])
pd.Series([1]) % pd.Series([0]) #0 NaN # dtype: float64 pd.Index([1]) % pd.Index([0]) # Int64Index([0], dtype='int64') np.array([1]) % np.array([0]) # array([0])
pd.show_versions()
on current master.
The text was updated successfully, but these errors were encountered:
this was set this way a while ago - Index should be the same
numpy is wrong as it doesn't coerce types
Sorry, something went wrong.
OK. Found inconsistencies between int/float Series also. Both should be inf as the same as truediv?
truediv
np.__version__ # '1.11.1' # OK pd.Series([4]) // pd.Series([0]) # 0 inf # dtype: float64 # NG pd.Series([4.]) // pd.Series([0.]) # 0 NaN # dtype: float64 # truediv, OK # pd.Series([4.]) / pd.Series([0.]) # 0 inf # dtype: float64
Added to the TODO list in #18824. FWIW all of the examples above except for pd.Series([4.]) // pd.Series([0.]) have been fixed.
pd.Series([4.]) // pd.Series([0.])
jbrockmendel
Successfully merging a pull request may close this issue.
Series
looks to be coerced tofloat
if the result containsNaN
orinf
. OtherwiseIndex
doesn't. Make it to be consistent in either way.Code Sample, a copy-pastable example if possible
output of
pd.show_versions()
on current master.
The text was updated successfully, but these errors were encountered: