Skip to content

ENH: add support for .ceil() and .floor() for series/frame #62306

@auderson

Description

@auderson

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

Currently ceil and floor is achieved by codes like:

df = df.mask(df > 0, 0)

this can be slow in terms of performance compared to native methods like np.ceil and np.floor

Feature Description

Add new .ceil and .floor method, possibly using np.ceil and np.floor

Alternative Solutions

df = pd.DataFrame(np.ceil(df.values, 0), index=df.index, columns=df.columns)

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions