I need to prepare a pandas DataFrame to write a TXT for submission to a third party on a strict format. When I use the following code directly it seems to work:
data['code'].apply(lambda x: '{:>{fill}}'.format(x, fill=15))
Bu when I try to actually change the DataFrame like:
data['code'] = data['code'].apply(lambda x: '{:>{fill}}'.format(x, fill=15))
It doesn't seem to take. How do I actually change the DataFrame?