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
Took care of 2 things here-- you're right Series.apply should always return a Series, and also need to override ndarray.round (though not immediately clear why), the root cause of this particular issue
Example below of it returning a NumPy array. This seems unexpected, given the documentation in the function.
Thanks!
Example:
Code:
import pandas as ps
import numpy as np
test = ps.Series(np.linspace(start=0, stop=1, num=20))
print test
print test.apply(lambda x: np.round(x, 1))
Note : this is equivalent to np.round(test, 1)
Output:
The text was updated successfully, but these errors were encountered: