How can I convert a dataframe, for example looking like this:
id | column! 1 | column 2?> | column 3
ABC1 | 1234 | text text | text!
ABC2 | 1234 | text text | text!
Into a dictionary, but while converting the column names to remove special characters and spaces. The conversion could look like something like label_id = re.sub('[^A-Za-z0-9]+', '', str(label_name)) but I am not sure how I could apply this to the dataframe -> dictionary conversion.