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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Help with Python

  • 03-01-2023 11:51am
    #1
    Hosted Moderators Posts: 23,208 ✭✭✭✭


    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,885 ✭✭✭✭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,529 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 Posts: 81,083 Mod ✭✭✭✭Sephiroth_dude




Advertisement