Reputation:
I have a csv file. I read and made a dictionary with its columns. but in dictionary I have a lot of /xa0
how I can remove them?
data=pd.read_csv('A.csv')
data.dropna(inplace=True)
Title = data['FIRST'].str.lower()
Abbr = data['1ST'].str.lower()
JobAbbreviation=dict(zip(Abbr, Title))
I tried the following but it doesn't work.
data = data.replace(u'\xa0', u'')
Upvotes: 3
Views: 898
Reputation: 863301
I think you need regex=True
for substrings replacement:
data = data.replace(u'\xa0', u'', regex=True)
Upvotes: 3