我关注cloudera blog on using spark-ts for time series analysis in scala。我想创建一个每小时频率的DateTimeIndex。博客中的示例显示了如何使用工作日频率创建DateTimeIndex,如下所示:
val dtIndex = DateTimeIndex.uniform(
new DateTime("2015-08-03"), new DateTime("2015-09-22"), new BusinessDayFrequency(1))
我希望在github repository of DateTimeIndex.scala from author Sandy Ryza中找到解决方案,但到目前为止无法弄明白。
我如何修改上述示例以生成每小时频率的索引?
答案 0 :(得分:2)
有一个HourFrequency
类:
val dtIndex = DateTimeIndex.uniform(
new DateTime("2015-08-03"), new DateTime("2015-09-22"), new HourFrequency(1))