Dealing with Special Characters in Data Frame

23 views
Skip to first unread message

Steves Gao

unread,
Mar 17, 2019, 12:32:02 PM3/17/19
to jup...@googlegroups.com

Hi Jupyter experts!

 

I have a question regarding dealing with special characters in a data frame situation.

 

For example some of my data may look this:

 

Column A                                    Column B                                      Column C

Ryan i$ 100% cool            “ Ryan i$ no*t cool”              “ Ryan i$ really co(ol!

 

 

Notice that there might a blank space somewhere in the data frame and some times I don’t even know what the special character is.

 

Currently, I have been trying to use the commend : mydata.replace('\?','',regex=True)

But it only works if I know what the special character is and I cannot put multiple characters in one line. I am wondering if you geniuses have a better solution.

 

Thanks for your help in advance!

 

Cheers,
Steve

 

Jürgen Hermann

unread,
Mar 19, 2019, 12:34:20 AM3/19/19
to Project Jupyter
That `regex=True` should give you a hint, use a character class i.e. `[…]`.
Reply all
Reply to author
Forward
0 new messages