Skip to content

Setting values on a DataFrame with tz aware DatetimeIndex fails #12104

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

Closed
szs8 opened this issue Jan 20, 2016 · 1 comment
Closed

Setting values on a DataFrame with tz aware DatetimeIndex fails #12104

szs8 opened this issue Jan 20, 2016 · 1 comment
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves Timezones Timezone data dtype

Comments

@szs8
Copy link

szs8 commented Jan 20, 2016

tdf = pd.DataFrame({'a': np.arange(10), 'b': np.arange(10) + 5}, 
                   index=pd.date_range('20160119 09:00', freq='5T', 
                                       periods=10, tz='US/Eastern'))
new_values = tdf.sample(2)['b'] + 100
tdf.loc[new_values.index, 'b'] = new_values.values

This fails with KeyError: "['2016-01-19T14:00:00.000000000+0000' '2016-01-19T14:05:00.000000000+0000'] not in index

This used to work. Not sure which version broke it.

@jreback
Copy link
Contributor

jreback commented Jan 20, 2016

this is a dupe of #12050, already fixed in master and will be in 0.18.0

thanks for the report

@jreback jreback closed this as completed Jan 20, 2016
@jreback jreback added Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves Timezones Timezone data dtype labels Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves Timezones Timezone data dtype
Projects
None yet
Development

No branches or pull requests

2 participants