样本: import numpy as np import sklearn.cluster as skc from sklearn import metrics import matplotlib.pyplot as plt mac2id = dict() onlinetimes = [] f = open('D:\python_source\Machine_study\mooc课程数据\课程数据\聚类\学生月上网时间分布-TestData.txt', encoding='utf-8') for
var stime = new Date('2016-03-14'); //开始时间 var etime = new Date('2016-03-20'); //结束时间 var times = etime.getTime()-stime.getTime(); //时间差的毫秒数 //计算出相差天数 var days=Math.floor(times/(86400*1000));
-(function($){ var caculation = function(gap){ var minutes = 1000 * 60 var hours = minutes * 60 var days = hours * 24 var years = days * 365 if(gap/years >= 1){ return parseInt(gap/years)+'年'; }else if(gap/days >= 30){ return parseInt(gap/days/30)+'