I am looking for suggestions as to how to get python to convert an empty space within a sub-string to a dash (-).
In the below dataframe column A has the raw data and need to add a dash to the sub-strings that have a space in them to get column B
Any suggestions how to overcome this?

df.A.str.replace(' ','-')is what you want