Skip to content

Conversation

@jokasimr
Copy link
Contributor

Fixes #3496

@jokasimr
Copy link
Contributor Author

jokasimr commented Aug 13, 2024

There was a suggestion in the original issue to not add a new method to Bins but instead add a keyword argument to drop_coords that determines if both outer and inner coords should be dropped (outer here meaning the coords on the binned data array and inner meaning coords on the underlying table).

But I decided to not do that for now, since then it would not be possible to drop only the inner coords.

@SimonHeybrock
Copy link
Member

Can you also use this addition in the place linked in the issue?

@jokasimr jokasimr enabled auto-merge August 13, 2024 08:05
Comment on lines 421 to 425
if x.bins is None:
x = x.drop_coords(drop)
else:
content = x.bins.constituents
content['data'] = content['data'].drop_coords(drop)
x = x.copy(deep=False)
x.data = _cpp._bins_no_validate(**content)
x = x.bins.drop_coords(drop)
return x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this just return da.drop_coords(drop) (see the alias da defined in line 418)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right

@jokasimr jokasimr disabled auto-merge August 13, 2024 08:23
@jokasimr jokasimr force-pushed the drop-binned-columns branch from 614a4d3 to cd80efc Compare August 13, 2024 08:26
@jokasimr jokasimr force-pushed the drop-binned-columns branch from cd80efc to f4655cd Compare August 13, 2024 08:26
@jokasimr jokasimr enabled auto-merge August 13, 2024 08:27
@jokasimr jokasimr merged commit 7168312 into main Aug 13, 2024
@jokasimr jokasimr deleted the drop-binned-columns branch August 13, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

drop_coords and drop_masks for binned data?

3 participants