DOC: add print statement in to_latex example
changed `df.to_latex` to `print(df.to_latex)`

closes #27789


@jorisvandenbossche Done! @jorisvandenbossche I am not able to understand what is causing the test failure. Can you help me out @sameshl that seems as an unrelated failure that you can ignore (I need to check if there is already an issue about this failure, it might be a flaky test) @sameshl Thanks a lot!