0

I have a pandas dataframe that has the begin date and end date of each event (like the table below)

Table

Is there a datetime tool in pandas that can help me convert this into a dataframe like the table below

Table

If there is no pandas function, what is the best way to accomplish this result? Thanks!

cndata
  • 13
  • 2
  • Please try to be more specific, it is unclear what you want to achieve and what you already tried. – Pierluigi Mar 01 '18 at 14:51
  • Looks like you would want to group by the months with time series data, similar to this: https://stackoverflow.com/a/24083253/3006366 – ode2k Mar 01 '18 at 14:53
  • So the original dataframe contains: `id`, `start_date` and `end_date` and you want to create a new dataframe with: `id`, month and year taken from `start_date` and minutes that is the difference between `start_date` and `end_date`. Am I correct? – Pierluigi Mar 01 '18 at 15:27
  • Yes. I want the minutes allocated to each month between the start date and end date – cndata Mar 02 '18 at 19:43

0 Answers0