Answer the question
In order to leave comments, you need to log in
How to ignore characters when reading csv file that are not uft-8 encoded?
Good afternoon!
I have a csv file that has been updated every day for several months now, which has a column of text. I usually read this:
with open ('groups.csv', 'r', encoding='utf-8') as f:
df = pd.read_csv(f, sep=';', index_col = False, encoding='utf-8')
Answer the question
In order to leave comments, you need to log in
Read the documentation about replace, this method replaces characters as you need, for example, there is a string '98 356', we cannot convert it to int, since there is a space in the string
a = '98 356'
a = replace(' ', '')
print(int(a))
Ответ: 98356
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question