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
fixed in #7786. Bug in that sign<0 & mask should have been (sign<0) & mask, with boolean numpy arrays (this didn't show up before because its done solely when filling with -np.inf (e.g. the sign of the inf).
problem when denominator is interger type and has 0 element
no such problem with pandas <= 0.13.1
print pd.version
print np.version
testdata=pd.DataFrame({'TL': (1,0), 'PI': (-0.01,-0.02)})
print "--- direct pd.Series division (wrong) : \n", (testdata.PI)/testdata.TL
print "--- np.where filtered (still wrong!!): ",np.where(testdata.TL>0.001,testdata.PI/testdata.TL,0 )
print "--- direct pd.Series division (OK for float type) : \n", testdata.PI/(testdata.TL.astype(float))
print "--- values division (correct)", testdata.PI.values/testdata.TL.values
-------------- Output ---------
0.14.0
1.7.1
--- direct pd.Series division (wrong) :
0 -inf
1 -inf
dtype: float64
--- np.where filtered (still wrong!!): [-inf 0.]
--- direct pd.Series division (OK for float type) :
0 -0.010000
1 -inf
dtype: float64
--- values division (correct) [-0.01 -inf]
The text was updated successfully, but these errors were encountered: