Skip to content
New issue

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

BUG: Series with datetime-like object ops raises TypeError #13043

Closed
sinhrks opened this issue Apr 30, 2016 · 1 comment
Closed

BUG: Series with datetime-like object ops raises TypeError #13043

sinhrks opened this issue Apr 30, 2016 · 1 comment
Labels
Bug Datetime Datetime data dtype Dtype Conversions Unexpected or buggy dtype conversions Numeric Operations Arithmetic, Comparison, and Logical operations Period Period data type Timedelta Timedelta data type Timezones Timezone data dtype
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Apr 30, 2016

Code Sample, a copy-pastable example if possible

pd.Series([pd.Timestamp('2015-01-01', tz='US/Eastern'),
           pd.Timestamp('2015-01-01', tz='Asia/Tokyo')]) + pd.Timedelta('1 days')
# TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 'Timedelta'

pd.Series([pd.Period('2015-01-01', freq='D')]) + pd.Timedelta('1 days')
# TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 'Timedelta'

Expected Output

ops must be applied to each elem

output of pd.show_versions()

current master.

NOTE: This works:

pd.Series([pd.Timestamp('2015-01-01', tz='US/Eastern'),
           pd.Timestamp('2015-01-01', tz='Asia/Tokyo')]) + pd.tseries.offsets.Day()
#0    2015-01-02 00:00:00-05:00
#1    2015-01-02 00:00:00+09:00
# dtype: object

pd.Series([pd.Period('2015-01-01', freq='D')]) + pd.tseries.offsets.Day()
#0   2015-01-02
# dtype: object
@sinhrks sinhrks added Bug Dtype Conversions Unexpected or buggy dtype conversions Numeric Operations Arithmetic, Comparison, and Logical operations labels Apr 30, 2016
@sinhrks sinhrks added this to the 0.18.2 milestone Apr 30, 2016
@jreback jreback added Difficulty Intermediate Datetime Datetime data dtype Timedelta Timedelta data type Timezones Timezone data dtype Period Period data type labels Apr 30, 2016
@jreback
Copy link
Contributor

jreback commented May 11, 2016

@sinhrks thank you sir!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Dtype Conversions Unexpected or buggy dtype conversions Numeric Operations Arithmetic, Comparison, and Logical operations Period Period data type Timedelta Timedelta data type Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants