import numpy as N ort='/storage/emulated/0/Download/' #ort='./' txt='tmax.txt' htm='smartphone.html' ja=N.genfromtxt(ort+txt,usecols=(0),dtype='i') mo=N.genfromtxt(ort+txt,usecols=(1),dtype='i') ta=N.genfromtxt(ort+txt,usecols=(2),dtype='i') tg=N.genfromtxt(ort+txt,usecols=(3),dtype='f') jo=N.arange(1893,2017,1);nj=len(jo) to=N.zeros(nj,float) tx=N.zeros(nj,float) tn=N.zeros(nj,float) for j in range(nj): print jo[j] w=N.ma.masked_where(ja!=jo[j],tg) w=w.compressed() to[j]=N.mean(w) tx[j]=len(w[w>30.]) tn[j]=len(w[w<0.]) ########### xo=N.vstack([N.arange(nj),N.ones(nj)]).T m,c=N.linalg.lstsq(xo,to)[0] print m,c ################# f=open(ort+htm,'w') f.write('\n') f.write('\n') f.write('\n') f.write('\n') f.write('\n') f.write('\n') f.write('\n') f.write('
\n') f.write('\n') f.write('\n') f.write('\n') f.close() print htm print 'geschrieben in' print ort print 'ENDE'