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

Add timeseries filtering example to illustrate subsetting of columns from selector values #3357

Merged
merged 3 commits into from
Mar 13, 2024

Conversation

joelostblom
Copy link
Contributor

I answered this SO question and thought it would be interesting with an example like that there too. The main thing it illustrates is how to select column based on selection values, but also puts it all together in a mini dashboards.

The code is somewhat long, but not long enough to be in a tutorial I think. I chose the "interactive" gallery category, but I think "advanced calc" would also work. There are better ways to compute time series correlation, but that's a parenthesis here.

altair-ex-2024-03-12_10.16.49.mp4

@joelostblom
Copy link
Contributor Author

The reason for the failing test is that pandas added numeric_only in 1.5 (at least to corr) and in 2.0 the default was changed to False. That means that we need set numeric_only=True as in this example, but in our CI we test the oldest version altair supports which is 0.25. Since the docs build, I believe this should be fine?

@jonmmease
Copy link
Contributor

What are you proposing? I think it's a good idea for the docs to use a more modern version of pandas.

@joelostblom
Copy link
Contributor Author

I agree and I was initially thinking that we didn't need to do anything as the docbuild ran fine, but I forgot that the examples are part of the test suite too. In my last two commits I fixed the issue I mentioned above as well as a mypy issue with renaming inside reset_index by using a slightly more verbose approach via rename instead. All tests pass now.

@jonmmease jonmmease assigned jonmmease and unassigned jonmmease Mar 12, 2024
@jonmmease jonmmease self-requested a review March 12, 2024 19:23
Copy link
Contributor

@jonmmease jonmmease left a comment

Choose a reason for hiding this comment

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

This looks good! In the future, I wonder if we should split out the ci jobs that run the examples so that we can use more up to date dependency versions. But not something to worry about today.

@joelostblom
Copy link
Contributor Author

Thank you for reviewing; merging!

@joelostblom joelostblom merged commit 89b717c into main Mar 13, 2024
20 checks passed
@mattijn
Copy link
Contributor

mattijn commented Mar 14, 2024

Nice example @joelostblom!

@binste
Copy link
Contributor

binste commented Mar 16, 2024

Agree, nice one :) And also thanks for the other PRs on improving the docs!

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

Successfully merging this pull request may close these issues.

4 participants