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

clip inplace? #15388

Closed
cnsgsz opened this Issue Feb 14, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@cnsgsz

cnsgsz commented Feb 14, 2017

Is it possible to support clip in place, just like numpy does? I assume that would speed up working with large dataframe/series as no extra copies will be needed.

If not, is that a workaround to achieve the same effect? I tried np.clip(df.values,-clip_bounds.values, clip_bounds.values, out=df.values), but realized that df.values is actually an expensive call as it is merging blocks underneath.

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Feb 14, 2017

Contributor

virtually all methods in pandas return new objects, exception are indexing. inplace does not provide ANY benefit, and should never have been added as it provides no utility and serves to confuse people.

so no, won't be adding any more inplace ops.

Contributor

jreback commented Feb 14, 2017

virtually all methods in pandas return new objects, exception are indexing. inplace does not provide ANY benefit, and should never have been added as it provides no utility and serves to confuse people.

so no, won't be adding any more inplace ops.

@jreback jreback closed this Feb 14, 2017

@jreback jreback modified the milestones: wont, won't fix Feb 14, 2017

@jorisvandenbossche

This comment has been minimized.

Show comment
Hide comment
@jorisvandenbossche

jorisvandenbossche Feb 14, 2017

Member

@jreback this clip function is actually one of rare methods where having an inplace arg actually would make sense, IMO (since it is possible to do it 'really' in place, opposed to something like sorting)

And it would also not be difficult to add, as DataFrame.where (which is what clip uses under the hood) already supports inplace.

Member

jorisvandenbossche commented Feb 14, 2017

@jreback this clip function is actually one of rare methods where having an inplace arg actually would make sense, IMO (since it is possible to do it 'really' in place, opposed to something like sorting)

And it would also not be difficult to add, as DataFrame.where (which is what clip uses under the hood) already supports inplace.

@jreback

This comment has been minimized.

Show comment
Hide comment
@jreback

jreback Feb 14, 2017

Contributor

I am ok with it - @cnsgsz if you would like to do an implementation would be great

Contributor

jreback commented Feb 14, 2017

I am ok with it - @cnsgsz if you would like to do an implementation would be great

@jreback jreback reopened this Feb 14, 2017

@jreback jreback modified the milestones: Next Major Release, won't fix Feb 14, 2017

@guygoldberg

This comment has been minimized.

Show comment
Hide comment
@guygoldberg

guygoldberg May 23, 2017

Contributor

Starting to work on it

Contributor

guygoldberg commented May 23, 2017

Starting to work on it

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 23, 2017

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 23, 2017

@guygoldberg guygoldberg referenced this issue May 23, 2017

Merged

ENH: Support inplace clip (#15388) #16462

1 of 1 task complete

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 24, 2017

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 24, 2017

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 25, 2017

guygoldberg added a commit to guygoldberg/pandas that referenced this issue May 25, 2017

@jreback jreback modified the milestones: 0.21.0, Next Major Release May 25, 2017

jreback added a commit that referenced this issue May 25, 2017

stangirala added a commit to stangirala/pandas that referenced this issue Jun 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment