Do you have a hint how I can create the correct format string from the input? I currently have a mixed format dataframe (some floats, some ints) that I would like to write the 'fast' way and I'm not sure how I can get it from the dataframe object. I could loop over df.dtypes and read out a dictionary that produces '%f' for any dtype that startswith('float') but maybe there's a better way?