Demo entry 6641344

23333

   

Submitted by zemin jiang on Sep 17, 2017 at 23:51
Language: Python. Code size: 655 Bytes.

"""
Created on Fri Sep 15 15:49:51 2017

@author: wrm
"""
import numpy as np
import matplotlib.pyplot as plt

pFile=open('C:/Users/wrm/Desktop/data3.13.txt')
rawdata=[]
for line in pFile:
  a=(line.split(','))
  rawdata.append(float(a[0]))
#print (rawdata)
#print (len(rawdata))

def qiujiepingjun(t):
    dataset=rawdata[t:]
    ans=np.mean(dataset)
    return ans

anssheet=[]
for t in range(300):
    anssheet.append(qiujiepingjun(t))

xzhou=[]
xzhou=[i for i in range(1,301)]
print anssheet
print xzhou

plt.plot(xzhou,anssheet)

for t in range(300):
    if anssheet[t+1]/anssheet[t]<1:
        print t
        break

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).