title: pandas print to latex a dataframe returns an unexpected result
body: <p>I have a pandas dataframe </p>
  
  <pre><code>&gt;&gt;&gt; ris
                     Pr Err    Tr Err    Pr Err    Tr Err    Pr Err    Tr Err
  Data     nodes                                                             
  boston   10      0.456532  0.458170  0.868836  0.810764  0.826163  0.775337
           30      0.512490  0.460417  0.623531  0.511936  0.600965  0.511689
           50      0.547000  0.447586  0.529250  0.377296  0.528913  0.398829
           100     0.781039  0.585664  0.452310  0.295945  0.480067  0.297470
           500     1.635246  1.084544  0.490629  0.188229  0.488209  0.174449
           1000    2.347967  1.325350  0.482844  0.153391  0.497174  0.139749
           5000    6.112860  3.248268  0.469981  0.141781  0.465061  0.055253
  crime    10      0.713751  0.534806  0.959765  0.909708  0.964622  0.932691
           30      0.897192  0.648438  0.957707  0.814946  0.924469  0.835406
           50      1.259947  0.835315  0.958826  0.763053  0.935411  0.752043
           100     1.788571  1.188414  0.893760  0.675943  0.878403  0.638281
           500     3.705343  1.925542  0.875850  0.442439  0.917819  0.210832
           1000    5.364042  2.730365  0.877851  0.401714  0.834504  0.095997
           5000   11.592207  5.696515  0.924210  0.128621  0.757942  0.008422
  diabetes 10      0.724064  0.708919  0.896751  0.884411  0.876967  0.871300
           30      0.776270  0.697421  0.748575  0.718090  0.770397  0.722314
           50      0.831268  0.738589  0.744160  0.670036  0.732472  0.681045
           100     0.944318  0.746765  0.725481  0.644612  0.739595  0.646943
           500     2.049824  1.295420  0.744597  0.638818  0.848764  0.342133
           1000    3.023125  1.945415  0.726805  0.632582  0.841408  0.202868
           5000    8.248108  4.950347  0.729375  0.614312  0.849506  0.049566
  j2m      10      0.262522  0.220741  0.704471  0.707829  0.975908  0.971793
           30      0.329172  0.249799  0.612609  0.595846  0.937233  0.913272
           50      0.540852  0.392339  0.569175  0.550119  0.905082  0.870621
           100     0.837123  0.648585  0.537721  0.499987  0.846324  0.802037
           500     1.939758  1.398511  0.472884  0.354905  0.683411  0.496362
           1000    2.981468  2.151604  0.431983  0.307520  0.663899  0.339811
           5000    6.577426  4.737849  0.408002  0.290080  0.452132  0.022331
  wine     10      0.821250  0.806193  0.940909  0.934531  0.940558  0.933438
           30      0.838295  0.817293  0.887308  0.862306  0.889729  0.876763
           50      0.897821  0.847260  0.872193  0.837761  0.872479  0.835796
           100     1.009768  0.909182  0.857645  0.814801  0.862258  0.809452
           500     1.675544  1.310232  0.855094  0.783809  0.940632  0.618788
           1000    2.094566  1.548781  0.863529  0.765906  0.973830  0.432291
           5000    5.004573  3.293214  0.861923  0.698045  0.920401  0.115565
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>and  I want to use this table in a latex documents. I want to print it exactly as it is but in latex format.</p>
  
  <p>I try to print it with </p>
  
  <p><code>print(ris.to_latex(float_format= lambda x: str(np.round(x, 3))))</code></p>
  
  <p>and I get this result that is not my original dataframe. </p>
  
  <pre><code>&gt;&gt;&gt; \begin{tabular}{llrrrrrr}
  \toprule
         &amp;      &amp;  Pr Err &amp;  Tr Err &amp;  Pr Err &amp;  Tr Err &amp;  Pr Err &amp;  Tr Err \\
  \midrule
  boston &amp; 10   &amp;         &amp;         &amp;         &amp;         &amp;         &amp;         \\
  crime &amp; 30   &amp;   0.457 &amp;   0.458 &amp;   0.869 &amp;   0.811 &amp;   0.826 &amp;   0.775 \\
  diabetes &amp; 50   &amp;   0.512 &amp;    0.46 &amp;   0.624 &amp;   0.512 &amp;   0.601 &amp;   0.512 \\
  j2m &amp; 100  &amp;   0.547 &amp;   0.448 &amp;   0.529 &amp;   0.377 &amp;   0.529 &amp;   0.399 \\
  wine &amp; 500  &amp;   0.781 &amp;   0.586 &amp;   0.452 &amp;   0.296 &amp;    0.48 &amp;   0.297 \\
  \bottomrule
  \end{tabular}
  
  &gt;&gt;&gt; 
  </code></pre>
  
  <p>how can I solve ?</p>
  
  <p>EDIT:</p>
  
  <p>with the command <code>print(ris.reset_index().to_latex(index=False))</code> I get:</p>
  
  <pre><code>\begin{tabular}{lrrrrrrr}
  \toprule
       Data &amp;  nodes &amp;     Pr Err &amp;    Tr Err &amp;    Pr Err &amp;    Tr Err &amp;    Pr Err &amp;    Tr Err \\
  \midrule
     boston &amp;     10 &amp;   0.456532 &amp;  0.458170 &amp;  0.868836 &amp;  0.810764 &amp;  0.826163 &amp;  0.775337 \\
     boston &amp;     30 &amp;   0.512490 &amp;  0.460417 &amp;  0.623531 &amp;  0.511936 &amp;  0.600965 &amp;  0.511689 \\
     boston &amp;     50 &amp;   0.547000 &amp;  0.447586 &amp;  0.529250 &amp;  0.377296 &amp;  0.528913 &amp;  0.398829 \\
     boston &amp;    100 &amp;   0.781039 &amp;  0.585664 &amp;  0.452310 &amp;  0.295945 &amp;  0.480067 &amp;  0.297470 \\
     boston &amp;    500 &amp;   1.635246 &amp;  1.084544 &amp;  0.490629 &amp;  0.188229 &amp;  0.488209 &amp;  0.174449 \\
     boston &amp;   1000 &amp;   2.347967 &amp;  1.325350 &amp;  0.482844 &amp;  0.153391 &amp;  0.497174 &amp;  0.139749 \\
     boston &amp;   5000 &amp;   6.112860 &amp;  3.248268 &amp;  0.469981 &amp;  0.141781 &amp;  0.465061 &amp;  0.055253 \\
      crime &amp;     10 &amp;   0.713751 &amp;  0.534806 &amp;  0.959765 &amp;  0.909708 &amp;  0.964622 &amp;  0.932691 \\
      crime &amp;     30 &amp;   0.897192 &amp;  0.648438 &amp;  0.957707 &amp;  0.814946 &amp;  0.924469 &amp;  0.835406 \\
      crime &amp;     50 &amp;   1.259947 &amp;  0.835315 &amp;  0.958826 &amp;  0.763053 &amp;  0.935411 &amp;  0.752043 \\
      crime &amp;    100 &amp;   1.788571 &amp;  1.188414 &amp;  0.893760 &amp;  0.675943 &amp;  0.878403 &amp;  0.638281 \\
      crime &amp;    500 &amp;   3.705343 &amp;  1.925542 &amp;  0.875850 &amp;  0.442439 &amp;  0.917819 &amp;  0.210832 \\
      crime &amp;   1000 &amp;   5.364042 &amp;  2.730365 &amp;  0.877851 &amp;  0.401714 &amp;  0.834504 &amp;  0.095997 \\
      crime &amp;   5000 &amp;  11.592207 &amp;  5.696515 &amp;  0.924210 &amp;  0.128621 &amp;  0.757942 &amp;  0.008422 \\
   diabetes &amp;     10 &amp;   0.724064 &amp;  0.708919 &amp;  0.896751 &amp;  0.884411 &amp;  0.876967 &amp;  0.871300 \\
   diabetes &amp;     30 &amp;   0.776270 &amp;  0.697421 &amp;  0.748575 &amp;  0.718090 &amp;  0.770397 &amp;  0.722314 \\
   diabetes &amp;     50 &amp;   0.831268 &amp;  0.738589 &amp;  0.744160 &amp;  0.670036 &amp;  0.732472 &amp;  0.681045 \\
   diabetes &amp;    100 &amp;   0.944318 &amp;  0.746765 &amp;  0.725481 &amp;  0.644612 &amp;  0.739595 &amp;  0.646943 \\
   diabetes &amp;    500 &amp;   2.049824 &amp;  1.295420 &amp;  0.744597 &amp;  0.638818 &amp;  0.848764 &amp;  0.342133 \\
   diabetes &amp;   1000 &amp;   3.023125 &amp;  1.945415 &amp;  0.726805 &amp;  0.632582 &amp;  0.841408 &amp;  0.202868 \\
   diabetes &amp;   5000 &amp;   8.248108 &amp;  4.950347 &amp;  0.729375 &amp;  0.614312 &amp;  0.849506 &amp;  0.049566 \\
        j2m &amp;     10 &amp;   0.262522 &amp;  0.220741 &amp;  0.704471 &amp;  0.707829 &amp;  0.975908 &amp;  0.971793 \\
        j2m &amp;     30 &amp;   0.329172 &amp;  0.249799 &amp;  0.612609 &amp;  0.595846 &amp;  0.937233 &amp;  0.913272 \\
        j2m &amp;     50 &amp;   0.540852 &amp;  0.392339 &amp;  0.569175 &amp;  0.550119 &amp;  0.905082 &amp;  0.870621 \\
        j2m &amp;    100 &amp;   0.837123 &amp;  0.648585 &amp;  0.537721 &amp;  0.499987 &amp;  0.846324 &amp;  0.802037 \\
        j2m &amp;    500 &amp;   1.939758 &amp;  1.398511 &amp;  0.472884 &amp;  0.354905 &amp;  0.683411 &amp;  0.496362 \\
        j2m &amp;   1000 &amp;   2.981468 &amp;  2.151604 &amp;  0.431983 &amp;  0.307520 &amp;  0.663899 &amp;  0.339811 \\
        j2m &amp;   5000 &amp;   6.577426 &amp;  4.737849 &amp;  0.408002 &amp;  0.290080 &amp;  0.452132 &amp;  0.022331 \\
       wine &amp;     10 &amp;   0.821250 &amp;  0.806193 &amp;  0.940909 &amp;  0.934531 &amp;  0.940558 &amp;  0.933438 \\
       wine &amp;     30 &amp;   0.838295 &amp;  0.817293 &amp;  0.887308 &amp;  0.862306 &amp;  0.889729 &amp;  0.876763 \\
       wine &amp;     50 &amp;   0.897821 &amp;  0.847260 &amp;  0.872193 &amp;  0.837761 &amp;  0.872479 &amp;  0.835796 \\
       wine &amp;    100 &amp;   1.009768 &amp;  0.909182 &amp;  0.857645 &amp;  0.814801 &amp;  0.862258 &amp;  0.809452 \\
       wine &amp;    500 &amp;   1.675544 &amp;  1.310232 &amp;  0.855094 &amp;  0.783809 &amp;  0.940632 &amp;  0.618788 \\
       wine &amp;   1000 &amp;   2.094566 &amp;  1.548781 &amp;  0.863529 &amp;  0.765906 &amp;  0.973830 &amp;  0.432291 \\
       wine &amp;   5000 &amp;   5.004573 &amp;  3.293214 &amp;  0.861923 &amp;  0.698045 &amp;  0.920401 &amp;  0.115565 \\
  \bottomrule
  \end{tabular}
  </code></pre>