I have a pandas dataframe. One of it's columns contains variable-length float arrays. I need to convert them to arrays of uint8 because actually these arrays contain grayscale images with values from 0 to 255. Currently arrays dimention is 1. I understand that it's possible to iterate over rows and do conversion in this cycle. But hope there is an out of box solution cause this task seems to be common. I also tryed the following df['grayscale255'] = df['grayscale255'].astype('uint8')
, but it doesn't work becuase
TypeError: only size-1 arrays can be converted to Python scalars