-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstations.py
29 lines (23 loc) · 922 Bytes
/
stations.py
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
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Platform : Station Name fetch
# Project Name : SYNOP DATA DECODER
# Author : Nikhil Dhandre
#------------------------------------------------------------------------------
import csv
def station_name(x):
with open('db/station_data.csv') as csvfile:
data_stations=csv.reader(csvfile, delimiter=',')
id_all=[]
station_no_all=[]
station_name_all=[]
for row in data_stations:
id=row[0]
station_no=row[1]
station_name=row[2]
id_all.append(id)
station_no_all.append(station_no)
station_name_all.append(station_name)
index=station_no_all.index(x)
return station_name_all[index]
#------------------------------------------------------------------------------