Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import csv
- def read_csv(filename):
- x=[]
- with open(filename) as csvfile:
- spamreader = csv.reader(csvfile)
- for i in spamreader:
- x.append(float(i[0]))
- return x
- def max_hui(x):
- max=0
- for i in x:
- if max<i:
- max=i
- return max
- def min_hui(x):
- min=1000
- for i in x:
- if min>i:
- min=i
- return min
- def sred(x):
- sum=0
- for i in x:
- sum+=i
- sr=sum/len(x)
- return sr
- x=read_csv('r1z1.csv')
- max_hui(x)-min_hui(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement