Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ head -n1 unsorted.csv && tail -n+2 unsorted.csv | sort -n --field-separator="," -k 1,1; } > sorted.csv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpanm (App::cpanminus) 1.7044 on perl 5.030003 built for x86_64-linux | |
Work directory is /home/stud/ga42vor/.cpanm/work/1591284564.30315 | |
You have make /usr/bin/make | |
You have LWP 6.44 | |
You have /bin/tar: tar (GNU tar) 1.29 | |
Copyright © 2015 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cpanm (App::cpanminus) 1.7044 on perl 5.030003 built for x86_64-linux | |
Work directory is /home/stud/ga42vor/.cpanm/work/1591284525.30081 | |
You have make /usr/bin/make | |
You have LWP 6.44 | |
You have /bin/tar: tar (GNU tar) 1.29 | |
Copyright © 2015 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
def listen_permutator(a,b): | |
comb = itertools.product(a,b) | |
comb = [flatten([j for j in i]) for i in comb] | |
#print(list(comb)) | |
comb = set(tuple(sorted(i)) for i in comb if len(i) == len(set(i))) | |
return [list(i) for i in comb] | |
def flatten(l): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def listen_permutierer(a,b): | |
produkt = itertools.product(a,b)#Kartesisches Produkt | |
produkt_set = [i for i in set(produkt)]#Alle einfachen Dubletten entfernen | |
output_set = produkt_set.copy()#Kopie, aus der die umgedrehten dubletten gelöscht werden | |
for i in range(len(produkt_set)):#Von vorne her alle einzelnen Einträge durchgehen | |
umgedrehtes_element = tuple(reversed(produkt_set[i]))#Das jeweilige Element umdrehen (1,2) → (2,1) | |
for j in range(i,len(produkt_set)):#Alle Elemente hinterhalb anschauen und das Element entfernen, wenn es dem Umgedrehten entspricht | |
if umgedrehtes_element == produkt_set[j]: | |
output_set[j] = -1 #Das jeweilige Element zum löschen markieren (Im output_set steht dann halt -1 statt dem (2,1)) | |
output = [i for i in output_set if i != -1] #Die Elemente löschen und ausgeben |
NewerOlder