Giter Site home page Giter Site logo

Comments (6)

VISWESWARAN1998 avatar VISWESWARAN1998 commented on September 22, 2024

take

from pandas.

VISWESWARAN1998 avatar VISWESWARAN1998 commented on September 22, 2024

Replaced absolute string slicing into split to resolve this issue

# YearBegin(), BYearBegin() use month = starting month of year.
# QuarterBegin(), BQuarterBegin() use startingMonth = starting
# month of year. Other offsets use month, startingMonth as ending
# month of year.
period_str = "".join([dt_char for dt_char in list(freqstr.split("-")[0]) if not dt_char.isdigit()])
if (period_str in ["MS", "QS", "YS"]):
    end_month = 12 if month_kw == 1 else month_kw - 1
    start_month = month_kw

Gives me

[4/4] Linking target pandas/_libs/tslibs/fields.cpython-310-x86_64-linux-gnu.so
[ True  True]

from pandas.

MarcoGorelli avatar MarcoGorelli commented on September 22, 2024

I don't think this is the solution, we need to go up some levels and look for something like freq.n

@natmokval you'd done a bunch of work in this area, so this might be interesting to you to try fixing?

from pandas.

VISWESWARAN1998 avatar VISWESWARAN1998 commented on September 22, 2024

I don't think this is the solution, we need to go up some levels and look for something like freq.n

@natmokval you'd done a bunch of work in this area, so this might be interesting to you to try fixing?

Can you elaborate more on this one?

from pandas.

natmokval avatar natmokval commented on September 22, 2024

@natmokval you'd done a bunch of work in this area, so this might be interesting to you to try fixing?

Yeah, sure, I would like to work on this.

from pandas.

VISWESWARAN1998 avatar VISWESWARAN1998 commented on September 22, 2024
period_str = "".join([
    dt_char for dt_char in list(freqstr.split("-")[0]) if not dt_char.isdigit()
])

Splits the freqstr and removes the digits. So it can properly parse 10MS, 10YS-JAN, 2B etc., I believe it is more viable option to absolute slicing

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.