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
import numpy as np
from pandas import Series
s = Series(range(3))
s2 = s.map(lambda x: np.where(x == 0, 0, 1))
print s2.dtype
In pandas 0.6.0, this returned 'float64', but now it returns 'object'. This change requires us to explicitly specify some dtypes to pandas constructors as a workaround. If this is the desired behavior, we can live with it - but wanted to alert you guys.
The text was updated successfully, but these errors were encountered:
Well, a good question is, why are you doing that instead of np.where(s == 0, 0, 1)? Vectorization is good :)
Fixed this in the above commit (np.where called with a scalar results in 0-dimensional arrays, so I inserted a hack to "unbox" the value inside). However I would expect the result to be integer and not float (the current behavior).
* commit 'v0.7.0rc1-73-g69d5bd8': (44 commits)
BUG: integer slices should never access label-indexing, GH pandas-dev#700
BUG: pandas-dev#680 clean up with check for py3compat
BUG: pandas-dev#680 rears again. cut off another hydra head
ENH: change to tree-like MultiIndex output with > 2 levels, GH pandas-dev#689
TST: added a test related to pandas-dev#680
BUG: related to closespandas-dev#691, removed cruft
BUG: closespandas-dev#691, assignment with ix and mixed dtypes
BUG: handle incomparable values when creating Factor, caused bug in py3
TST: Fixes for tests on Python 3.
BUG: pandas-dev#680, print consistently when dataframe is empty
TST: unit test for PR pandas-dev#684
ENH: Allow Series.to_csv to ignore the index.
BUG: raise exception in DateRange with MonthEnd(0) instead of infinite loop, GH pandas-dev#683
BUG: unbox 0-dimensional arrays in map_infer, GH pandas-dev#690
updated license and credits for overview
ENH: cythonize timestamp conversion in HDFStore
TST: ok, this appears to work GH pandas-dev#680
TST: even more woes GH pandas-dev#680
TST: unicode woes on windoze GH pandas-dev#680
TST: unicode codec test issue, GH pandas-dev#680
...
import numpy as np
from pandas import Series
s = Series(range(3))
s2 = s.map(lambda x: np.where(x == 0, 0, 1))
print s2.dtype
In pandas 0.6.0, this returned 'float64', but now it returns 'object'. This change requires us to explicitly specify some dtypes to pandas constructors as a workaround. If this is the desired behavior, we can live with it - but wanted to alert you guys.
The text was updated successfully, but these errors were encountered: