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

Series[datetime64[ns, tz]].__setitem__ fails to coerce for ndarray value #23932

Closed
TomAugspurger opened this issue Nov 26, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@TomAugspurger
Copy link
Contributor

commented Nov 26, 2018

What's the expected output for

In [9]: a = pd.Series(pd.DatetimeIndex(['2000', '2000'], tz="UTC"))

In [10]: a.loc[:] = np.array([pd.Timestamp('2000', tz="UTC")] * 2)

On master, we coerce self to object and then set.

In [11]: a
Out[11]:
0    2000-01-01 00:00:00+00:00
1    2000-01-01 00:00:00+00:00
dtype: object

Should we instead coerce value, rather than self?

@jbrockmendel

This comment has been minimized.

Copy link
Member

commented Nov 27, 2018

We should certainly at least try

@TomAugspurger

This comment has been minimized.

Copy link
Contributor Author

commented Nov 27, 2018

FYI, I have this working on my all-in-one branch (hoping to have a PR tomorrow).

In [4]: a.loc[:] = np.array([pd.Timestamp('2000', tz="UTC")] * 2)

In [5]: a
Out[5]:
0    2000-01-01 00:00:00+00:00
1    2000-01-01 00:00:00+00:00
dtype: datetime64[ns, UTC]

@TomAugspurger TomAugspurger referenced this issue Dec 12, 2018

Merged

REF: DatetimeLikeArray #24024

7 of 12 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.