Beispiel #1
0
dump1 = 'harvardx-2013-06-02'
userFile = '/' + ck_course + '/users.csv'
certFile = '/' + ck_course + '/certificates.csv'
enroll = '/' + ck_course + '/enrollment.csv'
uf1 = csv.reader(open(dump1 + userFile, 'r'))
uf2 = csv.reader(open(dump2 + userFile, 'r'))
cf1 = csv.reader(open(dump1 + certFile, 'r'))
cf2 = csv.reader(open(dump2 + certFile, 'r'))
ef1 = csv.reader(open(dump1 + enroll, 'r'))
ef2 = csv.reader(open(dump2 + enroll, 'r'))

u1dict = user.builddict(uf1)
u2dict = user.builddict(uf2)
c1dict = certificates.builddict(cf1)
c2dict = certificates.builddict(cf2)
e1dict = course_enrollment.builddict(ef1)
e2dict = course_enrollment.builddict(ef2)

OneNotTwo = compareUsers(u1dict, u2dict)
TwoNotOne = compareUsers(u2dict, u1dict)

for u in iter(OneNotTwo):
    if u in c1dict and c1dict[u].status =='downloadable':
        OneNotTwo[u] = 'y'

for u in iter(TwoNotOne):
    if u in c2dict and c2dict[u].status == 'downloadable':
        TwoNotOne[u] = 'y'

outfile = csv.writer(open('userDiff06020616' + ck_course +'.csv', 'w'))
outfile.writerow(['Users in 06/02 list but not in 06/16 list'])
Beispiel #2
0
'''

import csv
import user
import demographics.userprofile as uprofile
import course_enrollment as ce

csv.field_size_limit(1000000)
uIn = csv.reader(open('users.csv', 'r'))
uDict = user.builddict(uIn)

upIn = csv.reader(open('profiles.csv', 'r'))
upDict = uprofile.builddict(upIn)

ceIn = csv.reader(open('enrollment.csv', 'r'))
ceDict = ce.builddict(ceIn)

of = csv.writer(open('userDiffs.csv', 'w'))

of.writerow(['ids in user file, not in profiles file'])
for u in iter(uDict):
    if u not in upDict:
        of.writerow([u])

of.writerow(['ids in profiles file, not in user file'])
for p in iter(upDict):
    if p not in uDict:
        of.writerow([p])

of.writerow(['ids in user file, not in enrollment file'])
for u in iter(uDict):
dump1 = 'harvardx-2013-06-02'
userFile = '/' + ck_course + '/users.csv'
certFile = '/' + ck_course + '/certificates.csv'
enroll = '/' + ck_course + '/enrollment.csv'
uf1 = csv.reader(open(dump1 + userFile, 'r'))
uf2 = csv.reader(open(dump2 + userFile, 'r'))
cf1 = csv.reader(open(dump1 + certFile, 'r'))
cf2 = csv.reader(open(dump2 + certFile, 'r'))
ef1 = csv.reader(open(dump1 + enroll, 'r'))
ef2 = csv.reader(open(dump2 + enroll, 'r'))

u1dict = user.builddict(uf1)
u2dict = user.builddict(uf2)
c1dict = certificates.builddict(cf1)
c2dict = certificates.builddict(cf2)
e1dict = course_enrollment.builddict(ef1)
e2dict = course_enrollment.builddict(ef2)

OneNotTwo = compareUsers(u1dict, u2dict)
TwoNotOne = compareUsers(u2dict, u1dict)

for u in iter(OneNotTwo):
    if u in c1dict and c1dict[u].status == 'downloadable':
        OneNotTwo[u] = 'y'

for u in iter(TwoNotOne):
    if u in c2dict and c2dict[u].status == 'downloadable':
        TwoNotOne[u] = 'y'

outfile = csv.writer(open('userDiff06020616' + ck_course + '.csv', 'w'))
outfile.writerow(['Users in 06/02 list but not in 06/16 list'])
Beispiel #4
0

import csv
import user
import demographics.userprofile as uprofile
import course_enrollment as ce

csv.field_size_limit(1000000)
uIn = csv.reader(open("users.csv", "r"))
uDict = user.builddict(uIn)

upIn = csv.reader(open("profiles.csv", "r"))
upDict = uprofile.builddict(upIn)

ceIn = csv.reader(open("enrollment.csv", "r"))
ceDict = ce.builddict(ceIn)

of = csv.writer(open("userDiffs.csv", "w"))

of.writerow(["ids in user file, not in profiles file"])
for u in iter(uDict):
    if u not in upDict:
        of.writerow([u])

of.writerow(["ids in profiles file, not in user file"])
for p in iter(upDict):
    if p not in uDict:
        of.writerow([p])

of.writerow(["ids in user file, not in enrollment file"])
for u in iter(uDict):