Fixed latex output for multi-indexed dataframes - GH9778
Proposed fix for https://github.com/pydata/pandas/issues/9778

The formatting issue was caused by an incorrect number of elements in the (first) index columns of `strcols`. The length of reinserted columns was based on the number of elements per index level, but should have relied on the number of rows/occurrences of such elements.

This looks great to me. Can you please:
1. [add a note to what's new](http://pandas-docs.github.io/pandas-docs-travis/contributing.html#documenting-your-code)
2. [squash your changes into one commit](http://pandas-docs.github.io/pandas-docs-travis/contributing.html#committing-your-code) (we prefer not to have commits for which Travis tests fail merged into master, because it can complicate things like `git bisect`)
 @shoyer: Thanks a lot for your feedback.

I've just added a note to the next release, and squashed all the commits. Do let me know if there's anything else that should be added/updated.
 This looks to good to go, once the tests on Travis pass. I'll try to check later, but please feel free to ping me if you notice that's happened.
 @shoyer: I'm not sure how Travis is set up on this repo, but [tests are passing](https://travis-ci.org/yred/pandas) on my fork.
 Do we handle if there are `df.index.names` ?

Thanks for fixing this!
 @hayd: That's a good point.

It currently doesn't print out index names. Would that be expected with this fix or should I add it in a separate PR?
 At this point probably better to make a separate PR. But I do recall being able to export index names....

On Wed, Apr 15, 2015 at 6:11 PM, Yasin A. notifications@github.com
wrote:

> @hayd: That's a good point.
> 
> ## It currently doesn't print out index names. Would that be expected with this fix or should I add it in a separate PR?
> 
> Reply to this email directly or view it on GitHub:
> https://github.com/pydata/pandas/pull/9908#issuecomment-93610178
 @shoyer: it seems that regression happened a little earlier as well.

I'll be updating the code for that (separately), and potentially cleaning up `to_latex()` so that things are a bit clearer/cleaner.
 @yred Fantastic, thanks!
 thanks @yred !
