-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Support for "52–53-week fiscal year" / "4–4–5 calendar" #4511
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
Comments
Here is an academic paper on these fiscal calendars: http://www3.nd.edu/~carecob/April2010Conference/LeonePaper.pdf Home Depot (HD) is another company which uses a retail calendar (different from GMCR, however) (http://phx.corporate-ir.net/External.File?item=UGFyZW50SUQ9MTc3ODU4fENoaWxkSUQ9LTF8VHlwZT0z&t=1 ):
|
look at |
@jreback I posted an SO question about this |
I know, much better to ask here :) |
Okay, so once I have created a subclass of |
Create a test for it, then step thru until it fails, then see what else you need to do. I haven't created a new frequency so I don't have a roadmap, but this is how TDD works.
|
@jreback I have found a couple oddities.
leads to:
because in
The other is this great line:
|
Currently I am getting stuck.
eventually leads to a lookup in the |
freq is a string, you need to actually define new codes that eventually instantiate your class NEW_FREQ (pick a better name!) will be recognized as a valid code in the code maps then your class created |
Of course it will have a better name. It actual does not need to be a string. The method should take an offset.
|
needs to be a string (well hashable), easiest to keep the current standard the number have to do with non-conflicting with other periods periods are ultimately represented by integers, so the reverse translation needs to happen too |
Ultimately there has to be a string, but I can pass an offset in for freq That being said, is the reason historic for the int representation rather
|
why would you not use a string like everything else? In [1]: pr = period_range('2000',periods=5,freq='A')
the lookup table is just used to compute the offsets that govern the backing representation for the period index (e.g. the number that represents a unique period) so they are not optional; they are stored as numpy arrays; objects don't work here (well they work but you lose all efficiency) and are not a good idea in general |
@jreback What I mean about not having to use strings for
They both lead to:
|
@jreback As for ints, I wasn't referring to the int used to represent a
or
which should need to be stored only once for a given vector. |
I just read it; these correspond to the original scikit-timeseries codes. So I guess it IS historic. But for back compat, follow what its doing (and maybe note that; using a code that is available), maybe start at 10000 or something |
Any idea what the reason to keep using those codes? If they are only used for internal representations (i.e. the user never sees them, etc), it might make sense to tear them out and replace with a more meaningful object (perhaps the a reference to the Offset). An accessor on that object that provides those codes can still be kept around if needed. Having to keep two lookup tables up to date looks like it will cause maintenance issues and errors down the road. Further it looks to complicate adding new Offsets. For the time being I will just grab an int and use it, but it might be a good project to migrate away from the legacy ints. That being said, I have only done a precursory examination of how those codes are used. |
I haven't played around with this so I don't know that said, it's easy to try things to break tests (though have to be careful that u break something that not being tested!) and I suspect we should drop support for scikit-timeseries in any event |
Any recommendations for what I should call these new
|
these are 'Annual' right? |
Quarters. They are like the |
how about |
It isn't just any fiscal quarter, but rather one that tends to be used in retail. |
how about FQ52 and FQ4_4_5 ? |
not sure if there is a abbrev for 4_4_5 type |
In addition to adding the new Offset to the Now I am able to get as far as:
which dies with:
I can trace then to |
I don't think you need to mess with this, the base freq is FR_QTR (which just means that taking an arbitrary date you want to place it in the right quarter), which works for you I believe, this is a very-low level function, you just need to interpret the output of this |
Something seems wrong here:
correctly prints:
but:
leads to:
Strangely, the following both work:
|
See: http://en.wikipedia.org/wiki/4%E2%80%934%E2%80%935_calendar about the referenced calendars.
Certain companies, for example Green Mountain Coffee Roasters, Inc. (GMCR) use this calendar. See for example: http://files.shareholder.com/downloads/GMCR/1456137416x0x436353/9E2D04D9-79DE-4C08-A7C6-7B161E23E586/gmcr_2010_annual_report_lo.pdf
where it states:
Here is some more information on this calendar: http://www.nrf.com/modules.php?name=Pages&sp_id=391
Walmart releases its sales numbers on this calendar: http://stock.walmart.com/financial-reporting/comparable-store-sales
The text was updated successfully, but these errors were encountered: