Coder Social home page Coder Social logo

Comments (4)

bergnerjonas avatar bergnerjonas commented on June 15, 2024

Tried to reproduce. Your example for .round on a Series fails for me as well, however rounding single timedeltas (e.g. pd.Timedelta('1 days 23:18:00').round('d')) works fine.

from pandas.

rhshadrach avatar rhshadrach commented on June 15, 2024

Thanks for the report! Result of a git bisect:

commit 6dbeeb4009bbfac5ea1ae2111346f5e9f05b81f4
Author: Lumberbot (aka Jack)
Date:   Mon Jan 8 23:24:22 2024 +0100

    Backport PR #56767 on branch 2.2.x (BUG: Series.round raising for nullable bool dtype) (#56782)
    
    Backport PR #56767: BUG: Series.round raising for nullable bool dtype
    
    Co-authored-by: Patrick Hoefler

cc @phofl

Note that ser.dt.round('d') still works. I don't believe that Series.round having special logic for different dtypes is documented anywhere.

from pandas.

phofl avatar phofl commented on June 15, 2024

Yeah this is a bit weird, DataFrame.round never worked for those, Series.round now follows this behavior. We can either make both work or keep as is

from pandas.

rhshadrach avatar rhshadrach commented on June 15, 2024

Making this work for DataFrame.round seems undesirable - numeric columns would take the number of digits as an argument whereas timedelta/datetime would take a frequency. I'd lean toward keeping this as-is.

from pandas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.