Remove puntuation in string, except floats using Python

  jupyter-notebook, nltk, python

I am preprocessing text data from a csv file for machine learning purposes, I am using a Jupyter notebooks and have imported the nltk packages. I am trying to remove punctuation from text, I have done so using a function, how do I ignore punctuation (.) in a float number in the string? i.e 2.6 should stay 2.6 and not 26.

Source: Python Questions

LEAVE A COMMENT