finding repeated data sequences in a column

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed May 20 06:16:49 EDT 2009


yadin, understanding what you want is probably 10 times harder than
writing down the code :-)

> I have a a table, from where I can extract a column.

You can extract it? Or do you want to extract it? Or do you want to
process it? Etc.


> I wanna go down trough that column made of numbers
> examine undetermined chunks of data and see or detect if that sequence
> of chunk
> of data has been repeated before

What do you mean by "undetermined"? What kind of data? Where is this
data? How is this "chunk" shaped? Are you talking about a string?


> and if it has been repeated detect it by giving it a name in an
> adjacent column.

What kind of name? So you just need 2 names, like N and S for New and
Seen?
You can use a built-in set data structure to know if you have already
seen some data, while you scan the records.


> Imagine someting like this but made of 1800 numbers...

How are such 1800 disposed? Do you mean 1800 columns of 32 bit
numbers?


> how can I build up column 3(category)<

What does A, B and C mean?

Bye,
bearophile



More information about the Python-list mailing list