Blame view

Database/convert_s.py 299 Bytes
16f90fbc   Eduardo Eloy   database and impl...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import csv, re

fin = open("ii.csv", "rt")
for line in fin:
	s = line.split(",")
	if(float(s[0]) > 0):
		t = "1"
	else:
		t = "0"
	if(float(s[1]) > 0):
		h = "1"
	else:
		h = "0"
	if(float(s[2]) > 0):
		c = "1"
	else:
		c = "0"
	print(t+","+h+","+c+","+s[3]+","+s[4].replace('\n',''))
	
fin.close()