Skip to content

Instantly share code, notes, and snippets.

@priyankajayaswal1
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priyankajayaswal1/0b025ddd8155a0fd2a69 to your computer and use it in GitHub Desktop.
Save priyankajayaswal1/0b025ddd8155a0fd2a69 to your computer and use it in GitHub Desktop.
1 5 6 3 0 2 4
3 2 5 4 1 0 6
3 0 6 4 1 2 5
2 6 4 3 0 1 5
1 3 4 2 0 5 6
4 0 1 2 3 5 6
5 1 0 4 3 6 2
6 1 3 5 4 2 0
1 6 2 5 0 3 4
0 1 6 4 3 5 2
6 5 4 2 1 0 3
1 5 6 3 0 2 4
3 2 5 4 1 0 6
3 0 6 4 1 2 5
2 6 4 3 0 1 5
1 3 4 2 0 5 6
4 0 1 2 3 5 6
5 1 0 4 3 6 2
6 1 3 5 4 2 0
1 6 2 5 0 3 4
0 1 6 4 3 5 2
6 5 4 2 1 0 3
library(sqldf)
library(arules)
t1 = read.csv('newfsaraw2.csv')
dist = sqldf('select distinct(X1) from t1')
uuu = data.frame()
p = data.frame()
tiiii = data.frame()
for (i in 1:length(dist$X1))
{
u = dist$X1[i]
p = fn$sqldf('select * from t1 where X1= $u')
for ( j in 1:length(colnames(p)))
{
p[colnames(p)][j]=sort((p[colnames(p)[j]])[,],decreasing=TRUE)
}
tiiii= rbind(tiiii,p)
}
View(t1)
View(tiiii)
import random
import csv
wr = csv.writer(open('newfsaraw2.csv','w'),quoting=csv.QUOTE_ALL)
uu = Matrix = [random.sample(range(7), 7) for x in range(11)]
wr.writerows(uu)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment