我使用-v选项运行一个all-spark-notebook容器:
library(dplyr)
df %>% mutate(gap = cumsum(!c(TRUE, diff(as.Date(df$dt)) == 1))) %>%
group_by(gap,group) %>% mutate(duration = sum(freq, na.rm=TRUE)) %>%
ungroup() %>% select(-gap) %>% as.data.frame()
# group dt freq duration
# 1 groupA 2016-03-21 1 3
# 2 groupA 2016-03-22 1 3
# 3 groupA 2016-03-23 1 3
# 4 groupA 2016-03-26 2 2
# 5 groupA 2016-03-28 1 12
# 6 groupA 2016-03-29 3 12
# 7 groupA 2016-03-30 3 12
# 8 groupA 2016-03-31 5 12
# 9 groupB 2016-04-01 1 3
# 10 groupB 2016-04-02 2 3
然后我登录jupyter并尝试将csv文件上传到/ work。
[W 07:52:16.882 NotebookApp]权限被拒绝:work / gate店数据 - 浣花西.csv [W 07:52:16.883 NotebookApp] 403 PUT / api / contents / work /%E9%97%A8%E5%BA%97%E6%95%B0%E6%8D%AE-%E6%B5%A3% E8%8A%B1%E8%A5%BF.csv(10.0.10.195)2509.69ms referer = http://10.0.100.245:9999/tree/work