0

I have a dataframe which has a column with the name 'Discipline', and it has the data type 'object'. I want to convert object to string and so I applied the expression:

data['Discipline'] = data['Discipline'].astype(str)

But now data in 'Discipline' has only Cyrillic letters

But after that the datatype is still object.

What else can I try to get the intended result?

ouroboros1
  • 9,113
  • 3
  • 7
  • 26
  • As per the suggested duplicate, you can use `data['Discipline'] = data['Discipline'].astype('string')`. – ouroboros1 Aug 20 '23 at 09:09
  • 1
    An object is a string. So you don't need to convert. It seems you have an encoding problem. Add sample of your data – gtomer Aug 20 '23 at 09:11

0 Answers0