Skip to content
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

update Bars example to demo dataframe constructor #4656

Merged
merged 3 commits into from
Oct 23, 2020
Merged

Conversation

kcpevey
Copy link
Collaborator

@kcpevey kcpevey commented Oct 22, 2020

Updates the Bars example to demo dataframe constructor

I've struggled with creating Bars plots in the past. For this example, it turns out it was really easy to switch to dataframes. I thought it would be a better upgrade, but I'll submit it anyway.

I'm not sure what aspect I struggled with before (maybe I missed the aggregate step?). If I can get a better reproducible example, I'll create a new PR.

@kcpevey kcpevey added the type: docs Related to the documentation and examples label Oct 22, 2020
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please strip out the metadata, using something like strip_kernel:

#!/bin/bash
cp "$1" /tmp/
/usr/local/bin/jq --indent 1 \
    '
    (.cells[] | select(has("outputs")) | .outputs) = []
    | (.cells[] | select(has("execution_count")) | .execution_count) = null
    | .metadata = {"language_info": {"name":"python", "pygments_lexer": "ipython3"}}
    | .cells[].metadata = {}
    ' "$1" > /tmp/stripped.ipynb
cat /tmp/stripped.ipynb > "$1"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your snippet doesn't actually address the nbformat. Should both of those be removed completely?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine to leave; it needs to have some value, and whether that's 4.2 or 4.4 shouldn't matter.

@philippjfr
Copy link
Member

Thanks @kcpevey!

@philippjfr philippjfr merged commit 2a2f5ce into master Oct 23, 2020
@kcpevey kcpevey deleted the bars_doc branch October 23, 2020 12:48
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: docs Related to the documentation and examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants