-
Notifications
You must be signed in to change notification settings - Fork 0
/
pattern.py
96 lines (59 loc) · 6.57 KB
/
pattern.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 17:20:01 2020
@author: Romain
"""
import pandas as pd
l = "97624 1 224 0 52189 0 923 1 21066 0 693 0 56523 0 293 0 52189 0 922 1 33202 0 162 0 97624 1 384 0 21000 0 050 0 21066 0 603 1 21088 0 832 1 95422 1 242 0 35404 2 064 0 52167 0 711 1 89844 2 470 0 52189 0 920 1 09844 2 411 1 10945 1 553 0 21000 0 080 0 21088 0 831 1 52189 0 992 0 99844 2 492 0 89844 2 490 0 52189 0 911 1 10945 1 514 1 52167 0 713 1 97624 1 244 0 32101 0 180 0 89844 2 480 0 52189 0 930 1 75422 1 202 1 52167 0 720 1 35404 2 044 0 10945 1 552 0 52189 0 992 0 21066 0 614 1 56523 0 341 0 79844 2 402 1 32101 0 061 0 33202 0 092 0 75422 1 200 1 35404 2 154 0 85422 1 250 0 35404 2 194 0 52167 0 703 1 52189 0 971 1 52189 0 940 1 52189 0 933 1 21066 0 623 1 21088 0 832 1 21000 0 050 0 21088 0 861 1 21066 0 680 0 52167 0 701 1 33202 0 092 0 10945 1 572 0 21066 0 673 0 10945 1 542 1 21088 0 800 1 33202 0 172 0 33202 0 082 0 32101 0 120 0 89844 2 440 0 99844 2 494 0 21066 0 610 1 21066 0 643 1 99844 2 474 0 21088 0 803 1 10945 1 503 1 21088 0 803 1 56523 0 362 0 52189 0 943 1 85422 1 280 0 32101 0 021 0 33202 0 132 0 97624 1 264 0 21088 0 891 0 95422 1 291 0 52189 0 913 1 52167 0 763 1 10945 1 530 1 97624 1 384 0 52167 0 780 0 35404 2 034 0 52167 0 700 1 52189 0 921 1 21066 0 600 1 09844 2 412 1 89844 2 420 1 97624 1 354 0 21088 0 851 1 52167 0 763 1 52189 0 961 1 21000 0 060 0 21066 0 600 1 99844 2 473 0 21088 0 894 0 79844 2 402 1 21066 0 692 0 52189 0 954 1 99844 2 443 0 10945 1 521 1 21088 0 880 0 34303 1 183 0 21000 0 050 0 95422 1 241 0 56523 0 340 0 21088 0 864 1 77624 1 304 1 52167 0 732 1 21088 0 861 1 89844 2 480 0 21066 0 612 1 33202 0 012 0 52189 0 990 0 56523 0 243 0 21088 0 802 1 21000 0 090 0 21088 0 813 1 52189 0 932 1 10945 1 560 0 52167 0 792 0 56523 0 300 1 10945 1 582 0 10945 1 511 1 52189 0 903 1 77624 1 204 1 10945 1 521 1 21088 0 822 1 56523 0 393 0 21066 0 632 1 10945 1 594 0 52189 0 931 1 52189 0 962 1 32101 0 011 0 21000 0 030 0 97624 1 274 0 52189 0 933 1 21066 0 654 1 33202 0 002 0 21066 0 630 1 52167 0 752 1 97624 1 234 0 52189 0 963 1 52167 0 762 1 35404 2 154 0 10945 1 532 1 21088 0 863 1 52167 0 752 1 35404 2 164 0 21088 0 854 1 56523 0 373 0 52189 0 942 1 56523 0 253 0 21066 0 653 1 56523 0 330 0 09844 2 432 1 33202 0 022 0 05422 1 211 1 33202 0 062 0 95422 1 292 0 32101 0 071 0 52167 0 754 1 21066 0 642 1 10945 1 523 1 32101 0 111 0 21000 0 070 0 07624 1 314 1 21088 0 862 1 09844 2 422 1 34303 1 083 0 21066 0 662 0 21088 0 820 1 21066 0 672 0 21066 0 694 0 32101 0 191 0 99844 2 441 0 10945 1 570 0 97624 1 334 0 09844 2 434 1 10945 1 501 1 56523 0 393 0 34303 1 023 0 35404 2 144 0 52189 0 940 1 33202 0 012 0 21088 0 813 1 32101 0 130 0 21066 0 683 0 21088 0 832 1 99844 2 481 0 85422 1 250 0 52189 0 951 1 32101 0 171 0 99844 2 494 0 56523 0 361 0 21088 0 881 0 33202 0 022 0 35404 2 034 0 97624 1 354 0"
df = pd.DataFrame(columns = {"nbPrincipal", "bin1", "nbSec", "bin2"})
nbP = []
b1 = []
nbS = []
b2 = []
i = 0
while i < len(l):
if l[i] == " ":
i += 1
else :
a = ""
for j in range(5):
a = a + l[i]
i += 1
nbP.append(a)
i += 1
b1.append(l[i])
i += 2
b = ""
for j in range(3):
b = b + l[i]
i += 1
nbS.append(b)
i += 1
b2.append(l[i])
i+=1
df["nbPrincipal"] = nbP
df["bin1"] = b1
df["nbSec"] = nbS
df["bin2"] = b2
dfpri = df.sort_values(by=["nbPrincipal"])
dfsec = df.sort_values(by=["nbSec"])
df2 = df.sort_values(by=["nbPrincipal","nbSec"])
p = "0123456789 9762412240 5218909231 2106606930 5652302930 5218909221 3320201620 9762413840 2100000500 2106606031 2108808321 9542212420 3540420640 5216707111 8984424700 5218909201 0984424111 1094515530 2100000800 2108808311 5218909920 9984424920 8984424900 5218909111 1094515141 5216707131 9762412440 3210101800 8984424800 5218909301 7542212021 5216707201 3540420440 1094515520 5218909920 2106606141 5652303410 7984424021 3210100610 3320200920 7542212001 3540421540 8542212500 3540421940 5216707031 5218909711 5218909401 5218909331 2106606231 2108808321 2100000500 2108808611 2106606800 5216707011 3320200920 1094515720 2106606730 1094515421 2108808001 3320201720 3320200820 3210101200 8984424400 9984424940 2106606101 2106606431 9984424740 2108808031 1094515031 2108808031 5652303620 5218909431 8542212800 3210100210 3320201320 9762412640 2108808910 9542212910 5218909131 5216707631 1094515301 9762413840 5216707800 3540420340 5216707001 5218909211 2106606001 0984424121 8984424201 9762413540 2108808511 5216707631 5218909611 2100000600 2106606001 9984424730 2108808940 7984424021 2106606920 5218909541 9984424430 1094515211 2108808800 3430311830 2100000500 9542212410 5652303400 2108808641 7762413041 5216707321 2108808611 8984424800 2106606121 3320200120 5218909900 5652302430 2108808021 2100000900 2108808131 5218909321 1094515600 5216707920 5652303001 1094515820 1094515111 5218909031 7762412041 1094515211 2108808221 5652303930 2106606321 1094515940 5218909311 5218909621 3210100110 2100000300 9762412740 5218909331 2106606541 3320200020 2106606301 5216707521 9762412340 5218909631 5216707621 3540421540 1094515321 2108808631 5216707521 3540421640 2108808541 5652303730 5218909421 5652302530 2106606531 5652303300 0984424321 3320200220 0542212111 3320200620 9542212920 3210100710 5216707541 2106606421 1094515231 3210101110 2100000700 0762413141 2108808621 0984424221 3430310830 2106606620 2108808201 2106606720 2106606940 3210101910 9984424410 1094515700 9762413340 0984424341 1094515011 5652303930 3430310230 3540421440 5218909401 3320200120 2108808131 3210101300 2106606830 2108808321 9984424810 8542212500 5218909511 3210101710 9984424940 5652303610 2108808810 3320200220 3540420340 9762413540 6779504848"
i = 0
elem = []
while i < len(p):
x = ""
if p[i] == " ":
i += 1
else :
for j in range(10):
x = x + p[i]
i += 1
elem.append(int(x))
mylist = list( dict.fromkeys(elem))
v = []
for i in range(len(elem)):
for j in range(i+1,len(elem)):
if elem[i] == elem[j]:
v.append(elem[j])
v = list(set(v))