How to delete a character in Python

Asked

Viewed 51 times

0

I’m starting a study with data analysis, but I still don’t know how to delete characters

import re
import panda as pd 
df.rename (columns = ("nome_motorista***************": "nome_motorista")) 

that is to say character ****** in a table of 40000 names

1 answer

2

I believe you should change just as you are passing the data in the parameter columns, by the documentation this parameter receives a dict-like. All you have to do is exchange parentheses () by keys {}.

The right call to function rename would be:

df.rename(columns = {"nome_motorista***************": "nome_motorista"})

PS: I’m imagining that you are making the read calls correctly, since you didn’t put this part in the code, if this part is your complete code, there is more that needs to be done before.

See documentation from name

Browser other questions tagged

You are not signed in. Login or sign up in order to post.