hi all..
if i had a csv file that had data in the format:
1, male, 1997
2, male, 2000
3, female , 1977
etc
how would i pull all 3 columns out of the csv into lists
thanks for your help
User Profile
Collapse
-
thanks for your response bvdet. I think i found the problem. the portfolioHPR list was not being emptied after each loop .. and so was just getting bigger and bigger.
i have added [code=python] del porftolioHPR[:] [/code] after the calcs and it seems to have stopped the problem.
in the meantime I will try all your tips
thanks again... -
slowdown after each loop
Hi all
just put together this little bit of code... I am sure it is heavily flawed:(... but can someone please point out to me the reason why it becomes slower after every loop. thanks!!!
** ....i am using "globals()[]" to try and create dynamic variables.. i am guessing that this a very bad way to do it?
Code:j = 0 while j < x: s = 0
-
thanks for your reply .. i am looking forward to seeing some ubercode :)
dshimer .. btw .. is
Code:for i in range(5):print i
Code:i = 0 while i < 5: print i i = i + 1
Leave a comment:
-
newbie loop efficiency
Hi all,
I need some help understanding the efficiency of my code. I am new to python(and coding in general) :(
if i have a code like this
Code:L2 = [] L3 = [] i = 0 while i < len(L0): if L1[i] == X: L2.append(Y) L3.append(Z) else: L2.append(0) L3.append(0) i = i + 1
No activity results to display
Show More
Leave a comment: