2021年4月10日星期六

dask - applying map_partitions to clean text returns "'Series' object has no attribute 'columns'"

I am trying to lower case my training data using map_partition. It keeps returning me an error when trying to print the head of the dataframe. What am I missing to apply my clean function

def clean_text(df):      df['X_trn'] = df['X_trn'].apply(lambda text:text.lower())      return df    training = training.map_partitions(clean_text, meta=object)  
https://stackoverflow.com/questions/67040832/dask-applying-map-partitions-to-clean-text-returns-series-object-has-no-att April 11, 2021 at 10:04AM

没有评论:

发表评论