1

I am trying to analyze some german accounting data. I don't know if it's only a german thing but many companies in Germany have more than 12 month per fiscal year.

In my case i have a column for year and for "month" where the range in this column is 1-15.

Does anyone have some advice for me how to handle this properly in pandas for a timeseries analysis? I can't convert it to datetime for obvious reasons.

Edit: It's complicated when i want to make a bar chart of some values based on year and month. For normal datetime i see no problem. For this special thing I would combine year and period as a string and use it for plotting.

I was just wondering if there is a better solution or if pandas ist aware of this speciality.

  • 2
    Companies will do this when they change when their accounting year starts, having a slightly shorter or longer year to make the adjustment. How to handle it depends on what your analysis is trying to show. – jonrsharpe Jul 22 '16 at 14:40
  • 1
    This is a pretty weird format for time. Is the time in a specific format? – Nick Bull Jul 22 '16 at 14:40
  • @jonrsharpe: It has nothing to do with having a shorter or longer year. Every fiscal year has 12 month (periods) plus 3 (or more) additional periods. Maybe you can call it a "virtual month" because every period is as long as the calendar month. –  Jul 22 '16 at 14:44
  • It's hard to answer without knowing exactly what you're trying to do, but can you use the 'month' column as an offset from day 1 of the fiscal year? That should allow at least converting to an actual datetime object. – user2027202827 Jul 22 '16 at 14:45
  • @NickBull: The format of the date can vary. You can write it as 2016-13-01 for example. –  Jul 22 '16 at 14:45
  • @stefan2342xx oh right, weird. My above comment was based on the fact that my previous employer (not a German company, admittedly) did exactly that to switch from Apr-Mar to Jul-Jun – jonrsharpe Jul 22 '16 at 14:47
  • Hmm. That's really complicated stuff to deal with. Agree with @jonrsharpe that it will depend on what you're trying to do. What are you trying to do with the information? Scrap that, just re-read the question and you've already said. Afraid I am of no further help! – Nick Bull Jul 22 '16 at 14:47
  • I edited my question as added some typical thing i want to do on this data. –  Jul 22 '16 at 14:51
  • Maybe creat a `class` that have 2 attributs, one is a `datetime object`, the second and `int`for the month. And some method that swap the month from date with the 'correct' month ? – pwnsauce Jul 22 '16 at 14:51
  • @pwnsauce Could be a possible solution when there is nothing else. My hope is, that someone already had to deal with it. –  Jul 22 '16 at 14:53

0 Answers0