User Profile

Collapse

Profile Sidebar

Collapse
newmaid
newmaid
Last Activity: Feb 28 '08, 04:25 PM
Joined: Feb 15 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • newmaid
    started a topic csv to list

    csv to list

    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
    See more | Go to post

  • newmaid
    replied to slowdown after each loop
    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...
    See more | Go to post

    Leave a comment:


  • newmaid
    started a topic slowdown after each loop

    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
    ...
    See more | Go to post

  • newmaid
    replied to newbie loop efficiency
    thanks for your reply .. i am looking forward to seeing some ubercode :)

    dshimer .. btw .. is

    Code:
    for i in range(5):print i
    faster than


    Code:
     
    i = 0
    while i < 5:
        print i
        i = i + 1
    See more | Go to post

    Leave a comment:


  • newmaid
    started a topic newbie loop efficiency

    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
    ...
    See more | Go to post
No activity results to display
Show More
Working...