I have a function called gett(int) that returns a series upon every call. It works fine when I write like this :
print gett(0)
print gett(1)
and so on..
but when I try to automate same in a for loop like this :
for a in range(28):
print gett(a)
It works fine for only first value and I get following output:
[..series..]
[]
[]
[]
[]
..and all others empty
I am very very new to Python so this is might be very naive. Any help is highly appreciated. Thank you.
P.S. gett function :
trend = file("D:\\trend.csv", "r")
def gett(pos):
t = []
for x in trend:
temp = x.split(',')
temp = temp[4:]
t.append(temp)
t = t[25:]
temp = []
for a in t:
if a[pos] != '':
temp.append(a[pos])
############
t = temp
############
return t
trend?