Questions tagged [sequential-number]

36 questions
5
votes
1 answer

Numpy: populate a 2D numpy array with sequential integers

Say you want to create a 2D numpy array, and want to populate it with sequential integers. What are the options available? Example: import numpy a=numpy.array([[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14]]) In this case of course I could use range(15)…
FaCoffee
  • 6,303
  • 19
  • 76
  • 148
2
votes
7 answers

Windows/C# system-level sequential number generator?

Is there a managed system-level sequential number generator? DateTime.Now.Ticks won't do because the operations I'm doing sometimes occur more than once per tick. Requirement Clarifications: Process agnostic - there's really only one process that…
Daniel Schaffer
  • 52,912
  • 28
  • 108
  • 161
2
votes
3 answers

dplyr: Mutate a new column with sequential repeated integers of n time in a dataframe

I am struggling with one maybe easy question. I have a dataframe of 1 column with n rows (n is a multiple of 3). I would like to ad a second column with integers like: 1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,.. How can I achieve this with dplyr as a general…
TarJae
  • 8,026
  • 2
  • 8
  • 25
2
votes
5 answers

How to join sequential numbers to unrelated data (SQL Server)

This question is a followup to a previous question I had about discovering unused sequential number ranges without having to resort to cursors (Working with sequential numbers in SQL Server 2005 without cursors). I'm using SQL Server 2005. What I…
enriquein
  • 1,036
  • 1
  • 11
  • 28
2
votes
1 answer

SQL Server Order By GroupID Random but asc ID in each GroupID

I'm using SQL Server 2012. I want to set sequential numbers to Num field each time I execute the SQL with the rules as follows: Grp order to be randomized. ID field to be ascended. Could anyone shed some light for me? TABLE …
2
votes
2 answers

Trouble outputting full list of numbers using innerHTML

the following is code to create a sequential list of numbers from 1 to 10. I'd like to take this list and output in the div "pagination" using innerHTML. However, when I execute the script, the only thing that is outputted is the number 10. When…
Choy
  • 1,967
  • 10
  • 34
  • 48
1
vote
1 answer

Update SQL with consecutive numbering within a group

I found the technique to update rows of a table with consecutive numbers here: Update SQL with consecutive numbering The gist of the technique is to use (T-SQL): update myTable SET @myvar = myField = @myVar + 1 which is awesome and works very…
unubar
  • 306
  • 4
  • 14
1
vote
2 answers

Sequential Increase in Column value based on a condition R

I have an R data frame that has an ID column with multiple records for an ID. When the flag is set to 1 for an ID, I want to create a column new timeline that starts from 1 and increases sequentially in increments of 6 (1,6,12...). How can I achieve…
1
vote
1 answer

Sequential numbering based on another column (date) R

I need to make a column with sequential numbers based on the date. There are multiple rows of the same date, and should look like so: nest in.temp out.temp age date 1 501 (913) 18.0 11.5 0 06/02 2 501 (913) 17.5 12.0 0…
1
vote
1 answer

Number of occurrences of next value in a vector in R

I have a vector with random numbers from 1-7 and I want to be able to determine the next number in the vector that follows the first value so that I can look for patterns and get a 7x7 matrix of values that shows how often a specific number follows…
AtmoSci
  • 87
  • 1
  • 1
  • 6
1
vote
2 answers

How to create sequential number column in pyspark dataframe?

I would like to create column with sequential numbers in pyspark dataframe starting from specified number. For instance, I want to add column A to my dataframe df which will start from 5 to the length of my dataframe, incrementing by one, so 5, 6,…
max04
  • 2,375
  • 2
  • 10
  • 17
1
vote
1 answer

Excel scatter plot x axis displays only sequential numbers but not real data selected for x axis

I have an excel scatter plot with 5 different data series on single chart. First 4 series are working well. When I want to add a new series with similar x-axis data (0.0, 0.4, 0.9 .. ) the plot is displayed with x-axis values as 1,2,3 but not as the…
santu
  • 51
  • 8
1
vote
1 answer

Is sequential or random comparison more efficient?

I am wondering (purely out of curiosity) if it is more efficient to compare numbers sequentially or randomly. I initially thought that it would be more efficient to compare numbers sequentially, but I was not sure and I have know idea how I would go…
zoecarver
  • 3,888
  • 2
  • 18
  • 39
1
vote
1 answer

SQL Server query add sequential number to resuls

I have emergency contact information attached to contact records that I am making into their own contact records. I need to assign a temporary id to the new contact records for migration purposes. I was hoping to do this within my SQL query that…
0
votes
1 answer

How to sequentially number data populated by a Userform

I am a real newbie and have been searching on here for help but cannot find what I'm after. I have created a user form that populates data into a target worksheet, I need it to sequentially number each row of data and ensure that every time I…
Niska
  • 1
  • 1
1
2 3