I have a column in my pandas DataFrame that looks like this: 

```
df = pd.DataFrame([
    ['26.6 km'],
    ['19.67 km'],
    ['18.2 km'],
    ['20.77 km'],
    ['15.2 km'],
], columns=['Mileage'])

```

I have a function that removes the ' km' from the column:

```
def remove_words(column):
    return column.str.split(' ').str[0]

```

when I put it in my DataFrameMapper as:

```
mapper = DataFrameMapper([
     ('Mileage', [FunctionTransformer(remove_words)]),
     ], df_out=True)

```

...it returns error "'numpy.ndarray' object has no attribute 'str'"

Help!