Skip to content

DOC: Revise merging.rst with graphical examples #9899

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2015

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Apr 14, 2015

Closes #9301. Though further table size adjustment / plotter module refactoring is required, I'd like to ask any feedbacks for current output.

I've prepared table plotter under utils.doctools, but is there anywhere more appropriate?

cc @JanSchulz

merge_update png

@jreback jreback added the Docs label Apr 14, 2015
@jreback jreback added this to the 0.16.1 milestone Apr 14, 2015
@jreback
Copy link
Contributor

jreback commented Apr 14, 2015

@sinhrks looks gr8!

  • can you add a release note (and put in the highlites section with a link to this page, to show this off)
  • I think that you need to not render the result as that results in a blank line? (e.g. maybe need to change them to code-blocks?)

@jankatins
Copy link
Contributor

@sinhrks Wow, this looks great!

@jorisvandenbossche
Copy link
Member

Wonderful!
I will try to find some time next week to review this

@sinhrks sinhrks force-pushed the join_doc branch 2 times, most recently from 5ed5c50 to 8bdb958 Compare April 18, 2015 10:36
@sinhrks
Copy link
Member Author

sinhrks commented Apr 18, 2015

Adjusted table size and updated rendered output.

I think that you need to not render the result as that results in a blank line?

Indeed, should not. But using code block prevent images from rendered automatically. Does anyone know the way to hide block but output plot using ipython-directive? Otherwise, my idea is output static images during doc build, and link them from this doc.

@sinhrks sinhrks changed the title (WIP)DOC: Revise merging.rst with graphical examples DOC: Revise merging.rst with graphical examples Apr 18, 2015
@jreback
Copy link
Contributor

jreback commented Apr 28, 2015

pls add a note in the highlites section of whatsnew 0.16.1 with a pointer to this pages.

@sinhrks lgtm merge away

@sinhrks
Copy link
Member Author

sinhrks commented Apr 28, 2015

Thanks for the review. Added release note in highlites.

@JanSchulz, @jorisvandenbossche Let me merge this if there is no further suggestions until this weekend.

@jorisvandenbossche
Copy link
Member

@sinhrks I just wanted to finally take a look, but I don't see the image with the output anymore (get some message that the image contains errors).

@sinhrks
Copy link
Member Author

sinhrks commented May 3, 2015

@jorisvandenbossche Strange, I can built doc on my local. Can you attach error messages?

@jorisvandenbossche
Copy link
Member

No problem anymore. I meant the image of the built docs you posted here in the PR, but now I see it (don't know what was going wrong yesterday)

Do you have any idea where the empty code cells are coming from? As normally, the ipython directive with the suppress option should work for that (to execute something, but not show the output).

  • One comment: I would make the tables (certainly in the beginning) a bit smaller as 3 times 4x4 (the smaller, the easier to overview what happened I think
  • Wishlist: color the data frames, so you can more easily see in the result from which dataframe the data is coming (but certainly not needed for this PR ..)

One thing I was thinking. Towards the future, would it be simpler/more flexible to use html instead of matplotlib figure? For that we could use df.to_html() (would also render multi-index better), and then try to find some way to insert that html output into the rst during build time, so it can just be rendered. But not sure if this would be an easier approach as the matplotlib one now.

@jankatins
Copy link
Contributor

@jorisvandenbossche pandas html tables are probably fine in html docs but I wouldn't count on such constructs being able to be converted to PDF (e.g. pandas tables in markdown blow up horrible if converted with pandoc...)

That's actually one reason why it would be nice to have a df.to_markdown() or df.to_rst().

@shoyer
Copy link
Member

shoyer commented May 4, 2015

I agree with Joris that this would look a little nicer if it leveraged the existing HTML renderer instead of matplotlib. But this is still a nice improvement.

@sinhrks
Copy link
Member Author

sinhrks commented May 7, 2015

@jorisvandenbossche Thanks for the comments. Made tables little smaller and updated the rendered output. I still see blank blocks even if I use suppress. A workaround we can do in v0.16.1 is to use static images.

The reason I used mpl is to layout multiple tables to understand merging operation easier. It gets better if it can be done using html (or rst).

@jreback
Copy link
Contributor

jreback commented May 7, 2015

@sinhrks pls merge when ready

@sinhrks
Copy link
Member Author

sinhrks commented May 8, 2015

@jorisvandenbossche OK for this?

@jorisvandenbossche
Copy link
Member

yep, certainly for a first pass!
we should try to remove the empty blocks, but I also don't have the time today, so we can always improve later on (eg also the coloring)

jorisvandenbossche added a commit that referenced this pull request May 8, 2015
DOC: Revise merging.rst with graphical examples
@jorisvandenbossche jorisvandenbossche merged commit 34bb831 into pandas-dev:master May 8, 2015
@sinhrks sinhrks deleted the join_doc branch May 9, 2015 03:58
@jorisvandenbossche
Copy link
Member

@JanSchulz good point about the pdf output. But rst tables do work in latex output. So in principle we could specify in the sphinx build process that the output for this directive for latex should be different as for html.

@jorisvandenbossche
Copy link
Member

My idea was a bit like this:

  • extend the ipython directive to have a mode where the output of that node is 'injected' into the document (so the output is parsed as rst). In this way you can add normal text to the html file that depends on the ipython shell variables.
  • use df.to_html() to output it, and possibly do some styling to the result (colors indicating from which dataframe it came)
  • use some other output for the latex docs

But, I don't know if this is actually a better approach (easier, better result, ..) than what @sinhrks now already did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Revise "Merge, join, and concatenate" doc with graphical examples
5 participants