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
In Pandas version 0.12, you could apply the Python built-in divmod function to a Series and an integer:
Enthought Canopy Python 2.7.6 | 64-bit | (default, Jun 4 2014, 16:42:26)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> pd.__version__
'0.12.0'
>>> divmod(pd.Series(range(4)), 2)
(0 0
1 0
2 1
3 1
dtype: int64, 0 0
1 1
2 0
3 1
dtype: int64)
>>>
With version >= 0.13, it appears that this usage is no longer supported:
Enthought Canopy Python 2.7.6 | 64-bit | (default, Jun 4 2014, 16:42:26)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> pd.__version__
'0.14.1'
>>> divmod(pd.Series(range(4)), 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for divmod(): 'Series' and 'int'
Was this change intentional?
Some context: I was using this to read a climate datafile that had a 4-digit column holding combined month and day values. The original code looked something like: month, day = divmod(df['MODA'], 100), but broke after upgrading to version 0.14.
The text was updated successfully, but these errors were encountered:
In Pandas version 0.12, you could apply the Python built-in
divmod
function to aSeries
and an integer:With version >= 0.13, it appears that this usage is no longer supported:
Was this change intentional?
Some context: I was using this to read a climate datafile that had a 4-digit column holding combined month and day values. The original code looked something like:
month, day = divmod(df['MODA'], 100)
, but broke after upgrading to version 0.14.The text was updated successfully, but these errors were encountered: