阅读背景:

如何使用Python将csv文件中的datetime对象拆分为30分钟数组,并将每个数组导出为新的csv文件

来源:互联网 

I have a 10 Hz .csv data file which has as its date/timestamp in the same column in the following format, 2014-07-05 12:01:00.0 thru 2014-07-06 12:00:59.9 as one day worth of data in the file. I need to split into 30 minute blocks over a 24-hr period (48 per day) 12:01:00.0 - 12:29:59.9, 12:30:00.0 - 12:59:59.9, and so forth. Each split 30 minute block needs to be exported as its own text file preferably. I am very new to python (day 3), and I am trying my best but spinning my wheels. I'm on an internship and really need help. I'm not a programmer, just a chemist trying to use python to accomplish this task. I tried to split by rows (rows = 18000 for 30 mins), but since my data doesn't start evenly at 12:00:01, it messes up my row split calculation and doesn't give me an exact 30 minute split. I was told a datetime object would be needed to convert to a string. Any guidance or help would truly be appreciated. Thanks in advance. Here is what I have below and started to modify it for a datetime object, but really need some guidance:I have a 10 Hz .csv data file which has as its




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: