Ejemplo n.º 1
0
def get_featured_data():
    #old
    train_x = util.add_zero(
        pd.read_csv('../data/features/train_x_f.csv', dtype='float'))
    train_y = util.add_zero(
        pd.read_csv('../data/features/train_y_f.csv', dtype='float'))
    test_x = util.add_zero(
        pd.read_csv('../data/features/test_x_f.csv', dtype='float'))

    #yangdechuan's data
    # train = pd.read_csv('../data/WechatTrainData_post.csv',dtype='float')
    # test_x = pd.read_csv('../data/WechatTestData_post.csv',dtype='float').drop(['综合GPA'],axis=1)
    # train_y = pd.DataFrame({'综合GPA':train['综合GPA']})
    # train_x = train.drop(['综合GPA'],axis=1)
    return train_x, train_y, test_x
Ejemplo n.º 2
0
def view_attendance(request):
    date = request.GET.get('date', '')
    if date == '':
        today = timezone.now()
    else:
        today = datetime.datetime.strptime(add_zero(date), "%d %B, %Y")
    students = [student.user.get_attendance_data(today) for student in Student.objects.filter(is_active=True)]
    return render_to_response('view_attendance.html',{'students':students, 'date': today}, context_instance=RequestContext(request))
Ejemplo n.º 3
0
def view_attendance_tutor(request):
    date = request.GET.get('date', '')
    if date == '':
        today = timezone.now()
    else:
        today = datetime.datetime.strptime(add_zero(date), "%d %B, %Y")
    # Is this line needed ?
    #tutors = Tutor.objects.all()

    tutors = [tutor.user.get_attendance_data(today) for tutor in Tutor.objects.all()]
    return render_to_response('attendance_tutors.html',{'tutors':tutors, 'date': today}, context_instance=RequestContext(request))
Ejemplo n.º 4
0
def view_attendance(request):
    try:
        if request.session['centre'] == "All":
            students = Student.objects.all()
        else:
            centre_obj = Centre.objects.get(name=request.session['centre'])
            students  = Student.objects.filter(centre=centre_obj)
    except:
        students = Student.objects.all()

    date = request.GET.get('date', '')
    if date == '':
        today = timezone.now()
    else:
        today = datetime.datetime.strptime(add_zero(date), "%d %B, %Y")
    students = [student.user.get_attendance_data(today) for student in students.filter(is_active=True)]
    return render_to_response('view_attendance.html',{'students':students, 'date': today}, context_instance=RequestContext(request))