[英]Hourly data to daily data python
I have hourly data as shown.我有如图所示的每小时数据。 I want to convert hours to date.
我想将小时数转换为日期。 How can I do it?
我该怎么做?
I didn't quite understand the question as a simple matter to count a date you need a start point to start counting.我不太明白这个问题是计算日期的简单问题,您需要一个起点来开始计数。 I can say there has been 24 since I started counting what date is it but if I won't say when I started counting nobody can know what date is it.
我可以说自从我开始数它是什么日期以来已经有 24 次了,但是如果我不说我什么时候开始数,那么没有人知道它是什么日期。
But assuming you have a start point it becomes simple, take the hours for each start point and divide by 24, you'll get the days and leftover hours, and then add them to your start date and this way you'll get date and time.但是假设你有一个起点,它变得很简单,把每个起点的小时数除以 24,你会得到天数和剩余的小时数,然后将它们添加到你的开始日期,这样你就会得到日期和时间。
I am sorry if I did not understand you correctly, but this is the best I've realized from your question.如果我没有正确理解你,我很抱歉,但这是我从你的问题中意识到的最好的。 Hope it helps :)
希望能帮助到你 :)
Example: Start Point: 10/02/2020, Time: 00:00AM Hours: 354 hours End Point: 10/02/2020 + 354 hours = 10/02/2020 + 14 days + 18 hours = (24/02/2020, 6:00PM)
示例:起点:10/02/2020,时间:00:00AM 小时:354 小时 终点:10/02/2020 + 354 小时 = 10/02/2020 + 14 天 + 18 小时 = (24/02/2020 , 下午 6:00)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.