I have a dataframe df by which I am getting list of list by using this
data = [list(map(str,n.tolist())) for n in df.values]
after that I replace specific control character from data like this
data = [ [e.replace(u'\xa0', u'') for e in tempval ] for tempval in data ]
This works fine but I want this to be done in dataframe itself please suggest something.
You can use
DataFrame.replace
:Then for creating
list
oflists
convertDataFrame
tonumpy array
byvalues
and thentolist
: