How do you find similar sets of number?

Off-topic posts of interest to the "Everything" community.
Post Reply
Debugger
Posts: 500
Joined: Thu Jan 26, 2017 11:56 am

How do you find similar sets of number?

Post by Debugger » Tue May 21, 2019 8:05 am

How do you find similar sets of numbers from among 20 numbers (from 1 to 80)?
I have a large list and I have no idea how to do it?
I want to find - 10 repeating numbers in all sets.


Micro-example:
02,03,05,14,25,29,33,44,48,49,56,58,66,69,72,73,75,76,77,78
01,03,05,15,25,29,31,45,48,50,57,58,66,69,72,74,75,76,77,80

therube
Posts: 2236
Joined: Thu Sep 03, 2009 6:48 pm

Re: How do you find similar sets of number?

Post by therube » Tue May 21, 2019 10:37 am

a$="02,03,05,14,25,29,33,44,48,49,56,58,66,69,72,73,75,76,77,78"
b$="01,03,05,15,25,29,31,45,48,50,57,58,66,69,72,74,75,76,77,80"

Code: Select all

dim a(20)

for i = 1 to 20
c=pos(","=a$)
a[i]=a$(1,c-1), a$=a$(c+1)
next i

for i = 1 to 20
x=pos(a[i]=b$)
if x > 0, repeat$=repeat$(a[i]+",")
next i

print "repeat$=" repeat$
repeat$="03,05,25,29,48,58,66,69,72,75,76,77,"

Debugger
Posts: 500
Joined: Thu Jan 26, 2017 11:56 am

Re: How do you find similar sets of number?

Post by Debugger » Tue May 21, 2019 7:07 pm

s this a python script? PowerShell? How to use it?
How to apply this for 10000+ different sets of numbers?

4860(2010 year) to END (2019 year)
Number L1 to L20
CSV File: https://www25.zippyshare.com/v/0gLFugWf/file.html

therube
Posts: 2236
Joined: Thu Sep 03, 2009 6:48 pm

Re: How do you find similar sets of number?

Post by therube » Tue May 21, 2019 8:51 pm

pseudo-code, really (though I'd think it to be close to accurate, [BBx Basic]).


Now need a better understanding of what you're trying to accomplish?

You could do something like:

Code: Select all

grep.exe  [1-9][1-9][1-9][1-9].*;4;   wyniki.csv  >  4
& that would show all the records where ";4;" is common.
& you do run that in a loop, 1..80 > 1..80
then you'd have 80 files, named 1..80, where all records that contain ;#; are in that individual file

Knowing that you have 11676 lines in wyniki.csv (11675 records + 1 header),
you could run wc -l (word count -lines) on each of the output files & know that ;4; is found in 2614 records & ;80; is found in 1917 records...

I want to find - 10 repeating numbers in all sets.
Explain?

Debugger
Posts: 500
Joined: Thu Jan 26, 2017 11:56 am

Re: How do you find similar sets of number?

Post by Debugger » Wed May 22, 2019 3:31 pm

Can you explain how to process - 1,600,000,000,000 (yes!) sets of numbers, and how fast can do that?

Post Reply