-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Improve melt example (#23844) #28006
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
Conversation
MLopez-Ibanez
commented
Aug 18, 2019
•
edited
Loading
edited
- closes poor melt example in documentation #23844
What's the motivation for each of these changes? What's unclear about the original? |
The original is a poor example of melt (properly speaking, wide to long),
as it doesn't serve any purpose to have such two different features under
the same column. The proposed change in the PNG not only reflects the
example more closely (df3->cheese) but it is also a better example of
wide (same
feature spread in two columns) to long.
See also de description in the original bug report. At the end, I decided
to minimise the changes rather than copy the exact example from the JSS
paper cited in the bug report.
|
-1 on this, the example seems worse. Also, just removing the image will make it broken in the website, the call should be removed too. @jalammar may be you want to have a look at this and the associated issue? |
Removing the image? The patch does not remove the image. It replaces it with an updated image to fix the df3->cheese issue and to show an example where melt is actually useful/sensible. Quoting from bug #23844:
|
My bad about the image, I misunderstood. I see your point in the ticket, and having homogenous data in the melted columns makes sense, but I think this example is worse, don't use Something like a dataframe for GDP, having the id column as a country, and then having columns Also, not sure why the name of the DataFrame is Thanks! |
Sure, but that would require much more work to update the figures as there are no sources for the figures. I can create new figures from scratch, but they won't match the style of the existing figures.
No idea, it was there already in the example. I have only updated the figure to match the name in the existing example. |
I have the original figure and I'll be glad to upload it somewhere. I still don't see the point of this PR, though. Changing "height' and 'weight' to A and B seems objectively worse. There could be a benefit from an extra figure that has an additional column (perhaps Age?) to show 'wide' to 'long' format in a more pronounced way -- even though the figure already shows the purpose of melt and the data frame does get longer after the melt operation. |
So if we just change |
For future reference, I have uploaded the original assets here: It's a Keynote file: In the link below, I have also created:
|
Thanks for sharing those @jalammar. I was thinking some days ago for the visualizations in the carousel in https://datapythonista.github.io/pandas-web/, that would be nice to have them as svg. Not sure if it'll be tricky to create them, but I think that should make the files smaller, and also we don't need to keep track of the source files, since svg files are self contained. If that's finally a good idea, we can probably do the same with the files you shared. |
@datapythonista We can give it a shot. What software did you use to create those versions? Keynote does not export into SVG directly, but I'll see what options are out there to make that conversion. This is one option I've seen. Another I've heard of is to export to PDF then open in Illustrator and attempt to export to SVG from there. |
I used Google drive. It can export directly to svg, even if the svg looks more complex and bigger than what it could be. You can see those slides here: https://docs.google.com/presentation/d/1Yub5E6_Pto3WJaT_vqpwp9thlbuKqxJQclVmuZXBmu8/edit?usp=sharing I added shadows, but that was editing the file later with gimp, but not even sure if that makes things look better. |
Moved the conversation about the carousel to #28168. Since there is no agreement on the changes in this PR, I'm closing. @MLopez-Ibanez feel free to open a new PR based on the provided feedback. |