Questions tagged [sequence]

A sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence. In a relational database, a sequence is an object that is used to generate unique numbers for a primary key.

A sequence is an ordered list of objects (or events). Like a set, it contains members (also called elements or terms), and the number of terms (possibly infinite) is called the length of the sequence. Unlike a set, order matters, and exactly the same elements can appear multiple times at different positions in the sequence.

Sometimes, sequence is used as a generic name for both list, array and set for convenience.

In a , a sequence is an object that is used to generate unique numbers for a .

5959 questions
2
votes
2 answers

Error in the seq() function in r?

I have a really weird problem. I generated a variable through a calculation. Then I took the number and created a +0.02, -0.02 range (like, Number= 7.74, UpperRange=7.76, LowerRange=7.72). After that I wrote a for loop, which should check if the…
jupiter
  • 23
  • 6
2
votes
4 answers

Move value along a sequence

I am aiming to produce a sequence something like this: > c(1, rep(9, 7)) [1] 1 9 9 9 9 9 9 9 > c(9, 1, rep(9, 6)) [1] 9 1 9 9 9 9 9 9 > c(rep(9, 2), 1, rep(9, 5)) [1] 9 9 1 9 9 9 9 9 In essence, I have a sequence that stays constant, but I want to…
Quinn
  • 419
  • 1
  • 5
  • 21
2
votes
0 answers

Structuring batches with multi label sequence in LSTM rnn tensorflow network

Im pretty new to NNs and i m trying to solve the following problem in Python and tensorflow: I have a sequence of 4 timesteps consisting of 3 Inputs each timestep start sequence 1,1,1 2,2,2 3,3,3 4,4,4 end sequence 5,5,5 6,6,6 7,7,7 8,8,8 Then…
2
votes
7 answers

Find the longest decreasing sequence

I am trying to find the longest sequence of decreasing numbers in an array. I am not sure what I am doing incorrectly in the following code. public static int getDecSeq(double[] data) { int currentSeq = 1; int currentIndex = 1; int…
Robert
  • 589
  • 4
  • 7
2
votes
1 answer

Replace column values according to values of consecutive rows in pandas

I have a dataframe df_in defined as so: import pandas as pd dic_in = {'A':['aa','bb','cc','dd','ee','ff','gg','uu','xx','yy','zz'], 'B':['200','200','200','400','400','500','700','700','900','900','200'], …
Federico Gentile
  • 5,650
  • 10
  • 47
  • 102
2
votes
1 answer

Is there some function to combine multiple sequences over a function?

If I have two sequences (let [v1 '(1 2 3 4) v2 '(2 4 6 8)] ...) is there some way of combining them through a function to single vector, something like: (combine #(* % %2) [1 2 3 4] [2 4 6 8]) => [2 8 18 32] The "mapping" function would…
Northcode
  • 85
  • 5
2
votes
2 answers

Apache Thrift : difference between byte and binary types

I would like to send 1024 bytes of data using Thrift. It must be exactly 1024 bytes because it is a comparative benchmark with other frameworks. Thrift has two types to represent bytes : 'byte' and 'binary', but I don't know how to use these…
B. Clement
  • 298
  • 2
  • 13
2
votes
5 answers

Find first sequence episode

I am trying to create a vector indicating the end of a sequence. My data looks this : id time var wake 1 1 1 sleep 0 2 1 2 sleep 0 3 1 3 sleep 0 4 1 4 0 0 5 1 5 0 0 What I want is this (output…
giac
  • 4,261
  • 5
  • 30
  • 59
2
votes
1 answer

How to use oracle sequence.nextval

I need to increment my id. I have to increment by using sequence in oracle database. When i use INSERT INTO XXX (seq_xxx.nextval, ....) i have error invalid column name. EDIT: The problem was in capital letters SEQ_XXX.NEXTVAL is working fine.
Jan Maděra
  • 521
  • 3
  • 5
  • 17
2
votes
0 answers

How can I predict sequences of tuple using RNNs?

How can I predict sequences of tuple using RNNs? The question is as follows: 1. There is a number set: {1,2,3,4,5,6,7,8,9,...n}. 2. Arbitrary subset can be extracted from the set. For example:(2,3,4) 3. How to predict the sequences like…
2
votes
1 answer

Grouping a sequence of monotonically increasing integers based on a difference that resets

Consider a monotonically increasing integer sequence such as: x <- c(0, 3, 5, 8, 10, 16, 18, 35, 36) I would like to group these based on their difference from each other. If the difference is less than or equal to 4 I would like them to be in the…
JasonAizkalns
  • 20,243
  • 8
  • 57
  • 116
2
votes
0 answers

Create ascending groups based on consecutive sequence of numbers

I'm looking for a way to create ascending groups ($B) based on an sequence of numbers ($A). This is easy to do in excel by writing a new column with a logical statement like "if A = 1, then add B+1, else B" (assuming that the first group in A…
2
votes
1 answer

SIP dialog CSeq sequence number

I'm trying to make sense of the following two RFC sections with respect to SIP dialogs and incrementing CSeq sequence numbers: https://www.rfc-editor.org/rfc/rfc3261#section-12.2.1.1 https://www.rfc-editor.org/rfc/rfc3261#section-12.2.2 The first…
user1491636
  • 2,355
  • 11
  • 44
  • 71
2
votes
4 answers

How do you find a missing number in a table field starting from a parameter and incrementing sequentially?

Let's say I have an sql server table: NumberTaken CompanyName 2                      Fred 3                      Fred 4                      Fred 6                      Fred 7                      Fred 8                      Fred 11…
Eitan
  • 1,434
  • 6
  • 21
  • 53
2
votes
1 answer

Sequence Aggregation with Time Series Data in Graph Database

All, I am new to the graph database area and want to know if this type of example if applicable to a graph database. Say I am looking at a baseball game. When each player goes to bat, there are 3 possible outcomes: hit, strikeout, or walk. For each…
Brad
  • 813
  • 1
  • 10
  • 20