Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

python pandas code help

  • 30-12-2014 02: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