[Python] Dropping different values from multiple columns

Discussão em 'Python' iniciado por Stack, Fevereiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Pandas dataframe with 28 columns in total. Each one has a unique number after a name. I want to drop all the numbers from the columns but keep the name. How can I do that best?

    Here is an example of the columns:

    Miscellaneous group | 00002928 Alcoholic Beverages | 0000292 Animal fats group | 000029


    I tried .rename() already but to do this for 28 columns isn't efficient and is time consuming. It also creates a very long coding cell in Google Colab Notebook.

    Continue reading...

Compartilhe esta Página