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: incorrect casting in ndarray + DataFrame #22537

Closed
jbrockmendel opened this issue Aug 30, 2018 · 0 comments · Fixed by #22696 or #23114
Closed

BUG: incorrect casting in ndarray + DataFrame #22537

jbrockmendel opened this issue Aug 30, 2018 · 0 comments · Fixed by #22696 or #23114
Labels
Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype Timedelta Timedelta data type
Milestone

Comments

@jbrockmendel
Copy link
Member

tdi = pd.timedelta_range('1s', periods=10)
df = pd.DataFrame({'a': tdi, 'b': tdi})
arr = np.arange(2)

>>> df + arr
[...]
AssertionError
# should be TypeError, but close enough for government work

>>> arr + df
                a                      b
0 0 days 00:00:01 0 days 00:00:01.000000
1 1 days 00:00:01 1 days 00:00:01.000000
2 2 days 00:00:01 2 days 00:00:01.000000
3 3 days 00:00:01 3 days 00:00:01.000000
4 4 days 00:00:01 4 days 00:00:01.000000
5 5 days 00:00:01 5 days 00:00:01.000000
6 6 days 00:00:01 6 days 00:00:01.000000
7 7 days 00:00:01 7 days 00:00:01.000000
8 8 days 00:00:01 8 days 00:00:01.000000
9 9 days 00:00:01 9 days 00:00:01.000000
@gfyoung gfyoung added Timedelta Timedelta data type Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype labels Sep 1, 2018
@jreback jreback added this to the 0.24.0 milestone Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Datetime Datetime data dtype Timedelta Timedelta data type
Projects
None yet
3 participants