【发布时间】:2022-12-01 14:01:24
【问题描述】:
I'm trying to seperate a list of mailing addresses and names that are intertwined in a single column due to poor formating. I initially wanted to grab all of the entries that are alphanumeric so I can separate them however I'm having trouble with the .isalnum() function. My string is a mailing address so I can't remove all of the white space as it would ruin the formatting.
'123 main st'.isalnum()
doesn't work because of the white space and I can't quite figure out how to effectively check if this is correct.
【问题讨论】:
-
What's your data frame and expected output?
-
'123 main st'.replace(' ', '').isalnum()or using a regex.