Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

python pandas code help

Options
  • 30-12-2014 2:14am
    #1
    Closed Accounts Posts: 1,040 ✭✭✭


    Hi, i want to select a column and certain rows from a csv file using panda module in python.

    for example i want to select column 'temperature' and rows 20 to 60.

    can you help with the code please?

    import pandas as pd
    temp = pd.read_csv("dates.csv")
    saved_column=temp.temperature ...???


Comments

  • Hosted Moderators Posts: 3,331 ✭✭✭Splinter


    I'm not familiar with pandas myself. I'd only ever use the csv module but I understand pandas might be better for larger data. This may be able to help you. It looks like you can specify the line headers that you want and it'll parse the rest


Advertisement