Created
August 31, 2014 16:58
-
-
Save abevieiramota/85d543850645656d5eeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
infile = open(input.name,"r") | |
lines = infile.readlines() | |
number_of_lines = len(lines) | |
lista_data, lista_apple, lista_mic = [], [], [] | |
for line in lines[:-1:-1]: | |
line_pieces = line.split(',') | |
lista_data.append(datetime.datetime.strptime(line_pieces[0],"%Y/%m/%d")) | |
lista_apple.append(float(line_pieces[1])) | |
lista_mic.append(float(line_pieces[2])) | |
inicial_mic = lista_mic[0] | |
inicial_apple = lista_apple[0] | |
print len(lista_apple) | |
for x in range(0, len(lista_apple)): | |
lista_apple[x] = 100*lista_apple[x]/inicial_appla | |
for x in range(0, len(lista_mic)): | |
lista_mic[x] = 100*lista_mic[x]/inicial_mic | |
infile.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment