2,963 questions
2
votes
1
answer
117
views
Why does my Python solution for selecting 2 points from each interval give incorrect results for overlapping intervals?
I’m trying to solve the following Leetcode problem:
You are given a 2D integer array intervals where intervals[i] = > [starti, endi] represents all the integers from starti to endi
inclusively.
A ...
Advice
0
votes
13
replies
169
views
How to replace Joda dateTime and interval with Java.time
I am trying to replace Joda datetime and interval methods with Java.time and also trying to specify explicitly timezone as Duser.timezone=America/Chicago.
This my code fragment
public void ...
4
votes
5
answers
379
views
How to compute the union and intersection of time intervals with covariates by group id?
I am looking for an efficient way to compute the union and intersection of time intervals (start–stop format) by group (id), while keeping the covariates associated with each interval.
Each patient (...
1
vote
1
answer
65
views
In pandas, what is the difference between a datetime-based Interval and Period
In pandas, there are two obvious ways to represent timespans: Interval[datetime64] and Period. When do I use which? Is there a prefered one in all cases?
I couldn't find this in the documentation - ...
0
votes
2
answers
93
views
How to split overlapping time intervals in R, assign precedence, and fill gaps with dummy events?
I’m working with machine events data in R, where each event has a start and end time, a unique event code, and a precedence level (ordered factor). Events may overlap, and I need to transform this ...
4
votes
3
answers
143
views
Getting mean of multiple rows based on interval dataframe in R
Let's say I have the following dataframe
df1=read.table(text="ID POSITION S1 S2
1 1 10 10
1 2 20 0
1 3 10 0
1 4 20 0
1 5 10 50
2 1 10 0
2 2 20 10
2 3 20 10
2 4 20 10
2 5 20 ...
1
vote
1
answer
84
views
Can a value reach a given interval by just adding digits? [closed]
I've got a given value and interval and want to check if the value, if not inside the interval, can still reach the interval by just adding digits
Bottom/Top/Value
Bottom < Top
legende
Inside: ...
2
votes
1
answer
84
views
R predFit(): Problem with prediction interval for nls in two variables
I am fitting a nonlinear regression on a dataset with two explanatory variables Day and Treatment modelling a response Amount using {nls}. I want to get the predicted values for Amount together with ...
2
votes
3
answers
122
views
Group rows by group & overlapping time intervals & then keep highest priority row in R
I have a dataset as follows
data<- data.frame(group_ID= c("cred", "cred", "cred", "cyellow", "cyellow", "cgreen"),
...
1
vote
1
answer
49
views
Finding the most common interval in a list of doubles
I am currently stuck on evaluating a list of some Doubles representing time intervals. Let's say I have an unordered list of up to 100 values fluctuating around 1: [0.897, 0.912, ... 1.214, 0.981]
I ...
2
votes
0
answers
113
views
Finding the minimum cost at each point in time from a set of weighted intervals
Let’s say we have a list of intervals, each of which has a cost associated with it. Assume that there is always at least one interval active.
The solution would be a timeline of non overlapping ...
4
votes
6
answers
134
views
Counting dates in a range of dates
I have a pandas dataframe that contains two date columns, a start date and an end date that defines a range. I'd like to be able to collect a total count for all dates across all rows in the dataframe,...
2
votes
1
answer
76
views
chartjs 4.4 : not able to plot 2 time series in 1 graph
I have an issue with plotting 2 lines in 1 graph using chartjs: I get 2 graphs with 1 line in stead of 1 graph with 2 lines, and I think I made a very simpe error, but I can't find it. I have spend ...
-3
votes
3
answers
231
views
How should I idiomatically represent time intervals (not just durations) in C++?
I like C++11's std::chrono facilities, which let me work with:
time points
clocks
durations (= differences between time points)
but I occasionally need to work with time intervals, i.e. not just the ...
1
vote
3
answers
55
views
Combination of piso functions to create dataframe of last inspection dates for intervals of an asset?
I'm struggling with the right combo of piso functions to perform the following analysis:
Let's say I have a length of road with mile markers as such:
0---1---2---3---4---5
And let's say I have a ...