title: How to create a pandas dataframe with days and hours in a year in Python?
body: <p>I want to create a pandas dataframe consisting of all hours in a year. Therefore, there needs to be rows for each of the 8760 hours (365 days * 24 hours per day). This is relatively straightforward.</p>
  <p>However, I also want to have another column in the dataframe for days that corresponds to the hour. It means, until 24 hours, it'd be day 1. From 25th to 28th hour, it should Day 2 (2 in the Days column). This should be repeated until 365 days and 8760 hours.</p>
  <p>What kind of looping technique needs to be applied for this and I want to create pandas dataframe consisting of two columns for hours and days in a year as shown below:</p>
  <p><a href="https://i.stack.imgur.com/QmPj8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QmPj8.png" alt="enter image description here" /></a>
  .
  .
  .</p>
  <p><a href="https://i.stack.imgur.com/KiKRL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KiKRL.png" alt="enter image description here" /></a></p>