This is how I currently do it:
# Turn all table elements to strings
df = df.astype(str)
df.columns = df.columns.map(str)
df.index = df.index.map(str)
Is there a one liner that will turn df data, columns and indeces to strings?
Update
Out of curiosity I timed the various answers.
My method: 909 µs ± 37.9 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
@Wen's method: 749 µs ± 41.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
@COLDSPEED's method: 732 ns ± 44.4 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Hence the accepted answer.
df_string = df_to_all_strings(df)
– gbtimmon