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.

Help with Python

  • 03-01-2023 12:51PM
    #1
    Hosted Moderators Posts: 23,377 ✭✭✭✭


    I need a bit of help with Python. I picked a relatively small data set to do a CA on. Got it onto colab ok, but I can't seem to do anything with it. Need to tweak it, remove a column or two. All I've managed to do it put in header names.

    Anyone able to help me?



Comments

  • Registered Users, Registered Users 2 Posts: 2 Bateteh2


    In Python, you can use the pandas library to manipulate and analyze your data. Here are a few examples of common operations you can perform on a DataFrame:

    • Removing a column: To remove a specific column from your DataFrame, you can use the drop() function. Here's an example of how to remove a column called 'column_name':
    df = df.drop('column_name', axis=1)
    
    • Renaming columns: To rename a column, you can use the rename() function. Here's an example of how to rename a column called 'old_name' to 'new_name':
    df = df.rename(columns={'old_name':'new_name'})
    

    These are just a few examples of the many operations you can perform on a DataFrame using pandas. You can find more information on the pandas documentation website.

    It's important to note that these examples are assuming that you have loaded your data into a DataFrame called df, if you have loaded it into another variable you should replace df with that variable.



  • Registered Users, Registered Users 2 Posts: 12,958 ✭✭✭✭Calahonda52


    Have just started with Python, using jupiter notebook within the anaconda set up

    keep getting this error [*] when I hit run

    Thanks as always

    “I can’t pay my staff or mortgage with instagram likes”.



  • Administrators, Computer Games Moderators, Sports Moderators Posts: 32,665 Admin ✭✭✭✭✭Mickeroo


    I think that means 'busy', so either it's just taking a while to do something or something is blocking it from proceeding. Sorry, I'm not an expert by any means.



  • Moderators, Computer Games Moderators, Social & Fun Moderators, Paid Member Posts: 81,198 Mod ✭✭✭✭Sephiroth_dude




Advertisement