Extract all numeric characters from a pandas series (all groups)
问题 I am trying to use the str.extract('(\d+)') method on a pandas series to get the digits of a phone number that looks like: (123) 456-7890 Using this method only returns 123 but I want the output to be 1234567890 In general I want to know how to get all digits from a string without having to worry about groups. Thanks 回答1: Source DF: In [66]: x Out[66]: phone 0 (123) 456-7890 1 +321 / 555-7890 2 (111) - 666 7890 In this case it's much easier to remove all non-digits using '\D+' RegEx as it