Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8720653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:05:16+00:00 2026-06-13T07:05:16+00:00

After implementing a custom frequency in pandas by subclassing DateOffset , is it possible

  • 0

After implementing a custom frequency in pandas by subclassing DateOffset, is it possible to “register” an offset alias for that frequency so that the alias can be used in built-in pandas functions such as date_range and resample?

For example, suppose I implement a custom twice-monthly frequency:

from pandas.tseries.offsets import DateOffset, CacheableOffset

class TwiceMonthly(DateOffset, CacheableOffset):
    def apply(self, other):
        # Some date logic here

    @property
    def rule_code(self):
        return 'TM'

Now, instead of using TwiceMonthly() everywhere, I want to use the offset alias TM.

# Suppose s is a time series
s.resample('TM', how='sum')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T07:05:17+00:00Added an answer on June 13, 2026 at 7:05 am

    That’s not possible right now unfortunately. Aliasing is static.
    It would be a good feature to add though. Please check back on github (https://github.com/pydata/pandas/issues/2085). Additional feedback or a PR would be appreciated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just finished implementing a custom membership provider and after the whole thing was
After reading the MSDN article ( http://msdn.microsoft.com/en-us/magazine/2009.01.genevests.aspx ) on implementing a Custom STS using
I implementing OLE DB provider for my custom database. It will be used from
I was implementing a custom CellTable that has a infinite scroll feature using the
Are there any recommended resources for implementing a custom membership provider that uses oAuth?
In Spring MVC, one can define interceptors that can perform work before and after
I am implementing UITableViewCells that have a custom background and expands when tapped. I
I am implementing the UIImagePickerController and I have a last custom step after (1)
After implementing most of the common and needed functions for my Graph implementation, I
I'm having an issue implementing an excel feature I'm after, this is my data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.