Skip to content

Instantly share code, notes, and snippets.

@dinnouti
Created January 28, 2020 15:10
Show Gist options
  • Save dinnouti/0cb3ce089fbd058b149cdb45f01a55ed to your computer and use it in GitHub Desktop.
Save dinnouti/0cb3ce089fbd058b149cdb45f01a55ed to your computer and use it in GitHub Desktop.
Python convert string with non-digits characters to float
df['Total $'].replace('[^.0-9]', '', regex=True).astype(float)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment