-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathamount_of_precipitation.py
More file actions
36 lines (25 loc) · 956 Bytes
/
amount_of_precipitation.py
File metadata and controls
36 lines (25 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Platform : RRR Amount of precipitation since 0300 GMT
# Project Name : SYNOP DATA DECODER
# Author : Nikhil Dhandre
# Start Date : 09-07-2016
# Last Modified : 21-09-2016
#------------------------------------------------------------------------------
import csv
def precipitation_amount(x):
with open('db/amount_of_precipitation.csv') as csvfile:
N_data=csv.reader(csvfile, delimiter=',')
code_all=[]
N_all=[]
for row in N_data:
code=row[0]
N=row[1]
code_all.append(code)
N_all.append(N)
print code_all
index=code_all.index(x)
return N_all[index]
if __name__=="__main__":
print(precipitation_amount("062"))
#------------------------------------------------------------------------------