time-series

Reduce daily data to monthly using Google Earth Engine

£可爱£侵袭症+ 提交于 2021-01-27 10:11:17
问题 I am looking at precipitation data (both GPM and CHIRPS) for different provinces in Indonesia using Google Earth Engine. GPM is sub-daily (every 30 minutes) and CHIRPS is daily. I am only interested in getting the monthly values. Unlike here and here I am not interested in getting the multi-annual monthly values, but simply the average of each month and make a time series. Here I found a way to create a list of values containing the mean of each month. Edit: Thanks to Nicholas Clinton's

How to plot multiple series/lines in a time series using plotly in R?

拥有回忆 提交于 2021-01-23 01:59:12
问题 I have a time series of several years that I need to plot mm/dd on the x-axis and multiple years on the y-axis using plot_ly. I have generated a sample data here: date<-seq(as.Date("2010-11-22"),as.Date("2016-05-26"),by ="days") sales = runif(2013, 2000, 6000) df = data.frame(date,sales) I plotted this data and get this: plot_ly(df,x= ~date) %>% add_lines(y = ~sales,color=I("red")) Now, I tried to plot multiple y-axis using plot_ly : plot_ly(df, x = ~date) %>% add_lines(y = ~sales, df$date <=

Pandas - Convert dataframe with start and end date to daily data

本秂侑毒 提交于 2021-01-21 08:29:47
问题 I have one record per ID with start date and end date id age state start_date end_date 123 18 CA 2/17/2019 5/4/2019 223 24 AZ 1/17/2019 3/4/2019 I want to create a record for each day between the start and end day, so I can join daily activity data to it. The target output would look something like this id age state start_date 123 18 CA 2/17/2019 123 18 CA 2/18/2019 123 18 CA 2/19/2019 123 18 CA 2/20/2019 123 18 CA 2/21/2019 … 123 18 CA 5/2/2019 123 18 CA 5/3/2019 123 18 CA 5/4/2019 And of

R: convert dates from daily to weekly and plotting them

五迷三道 提交于 2021-01-20 12:26:46
问题 I am trying to learn how to deal with time series data. I created some fake daily data, tried to aggregate it by week and then plot it: set.seed(123) library(xts) library(ggplot2) date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages_in_dollars <- rnorm(731,100,10) final_data <- data.frame(date_decision_made, property_damages_in_dollars) y.mon<-aggregate(property_damages_in_dollars

R: convert dates from daily to weekly and plotting them

天涯浪子 提交于 2021-01-20 12:24:10
问题 I am trying to learn how to deal with time series data. I created some fake daily data, tried to aggregate it by week and then plot it: set.seed(123) library(xts) library(ggplot2) date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages_in_dollars <- rnorm(731,100,10) final_data <- data.frame(date_decision_made, property_damages_in_dollars) y.mon<-aggregate(property_damages_in_dollars

R: Overlaying Points on a Graph

回眸只為那壹抹淺笑 提交于 2021-01-20 09:42:18
问题 This bounty has ended . Answers to this question are eligible for a +50 reputation bounty. Bounty grace period ends in 15 hours . stats555 wants to draw more attention to this question: Hello! I am trying to figure out a way to show the distribution of points between the minimum and the maximum values of a time series graph (using the R program language, using the "plotly" library). I have figured out how to plot the maximum and minimum value, and then show an interval between these points -

How to use time-series with Sqlite, with fast time-range queries?

元气小坏坏 提交于 2021-01-18 05:30:28
问题 Let's say we log events in a Sqlite database with Unix timestamp column ts : CREATE TABLE data(ts INTEGER, text TEXT); -- more columns in reality and that we want fast lookup for datetime ranges, for example: SELECT text FROM data WHERE ts BETWEEN 1608710000 and 1608718654; Like this, EXPLAIN QUERY PLAN gives SCAN TABLE data which is bad, so one obvious solution is to create an index with CREATE INDEX dt_idx ON data(ts) . Then the problem is solved, but it's rather a poor solution to have to

R: convert date from character to datetime [duplicate]

旧时模样 提交于 2021-01-15 19:20:04
问题 This question already has an answer here : converting datetime string to POSIXct date/time format in R (1 answer) Closed 4 years ago . I have df$date as character type below: date 1 "2016-04-10T12:21:25.4278624" 2 "2016-04-12T10:01:42.9573987" 3 "2016-04-12T10:02:15.2168753" 4 "2016-04-12T10:02:45.3005686" I want to convert it to datetime object and tried as.Date(df$date) and the output is "2016-04-10" "2016-04-12" "2016-04-12" "2016-04-12" I also tried as.POSIXlt(df$date) and the output is

R: convert date from character to datetime [duplicate]

梦想的初衷 提交于 2021-01-15 19:11:53
问题 This question already has an answer here : converting datetime string to POSIXct date/time format in R (1 answer) Closed 4 years ago . I have df$date as character type below: date 1 "2016-04-10T12:21:25.4278624" 2 "2016-04-12T10:01:42.9573987" 3 "2016-04-12T10:02:15.2168753" 4 "2016-04-12T10:02:45.3005686" I want to convert it to datetime object and tried as.Date(df$date) and the output is "2016-04-10" "2016-04-12" "2016-04-12" "2016-04-12" I also tried as.POSIXlt(df$date) and the output is

R: convert date from character to datetime [duplicate]

这一生的挚爱 提交于 2021-01-15 19:05:45
问题 This question already has an answer here : converting datetime string to POSIXct date/time format in R (1 answer) Closed 4 years ago . I have df$date as character type below: date 1 "2016-04-10T12:21:25.4278624" 2 "2016-04-12T10:01:42.9573987" 3 "2016-04-12T10:02:15.2168753" 4 "2016-04-12T10:02:45.3005686" I want to convert it to datetime object and tried as.Date(df$date) and the output is "2016-04-10" "2016-04-12" "2016-04-12" "2016-04-12" I also tried as.POSIXlt(df$date) and the output is