I am reading in a fixed-width file with read_fwf, and I need white space to be preserved, as the form uses blanks as a response type. I have looked for a keyword/parameter that changes the default settings which strip this white space, but I'm not sure if one exists. I saw the exact same question on here, which was not resolved until the user solved this issue, but not with pandas read_fwf
After calling read_fwf into a df, I tried padding the beginnings/ends of my strings with extra characters, but it didn't solve the problem that information was being lost due to the white space stripping in the first place.
df = pd.read_fwf(file, widths=widths)