I am looking for an efficient way to remove unwanted parts from strings in a DataFrame column.
Data looks like:
time result 1 09:00 +52A
There's a bug here: currently cannot pass arguments to str.lstrip and str.rstrip:
str.lstrip
str.rstrip
http://github.com/pydata/pandas/issues/2411
EDIT: 2012-12-07 this works now on the dev branch:
In [8]: df['result'].str.lstrip('+-').str.rstrip('aAbBcC') Out[8]: 1 52 2 62 3 44 4 30 5 110 Name: result