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

docs(altair): remove to_pandas from altair example #8951

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

gforsyth
Copy link
Member

@gforsyth gforsyth commented Apr 12, 2024

Noticed in @koaning's livestream that we never updated the Altair example to remove the call to to_pandas

Here's the local render:

2024-04-12_10-13

@cpcloud cpcloud added this to the 9.0 milestone Apr 12, 2024
@cpcloud cpcloud added the docs Documentation related issues or PRs label Apr 12, 2024
Copy link
Member

@cpcloud cpcloud left a comment

Choose a reason for hiding this comment

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

Nice

@cpcloud cpcloud merged commit eecbcea into ibis-project:main Apr 12, 2024
19 checks passed
@gforsyth gforsyth deleted the altair_integration branch April 12, 2024 14:38
@koaning
Copy link

koaning commented Apr 12, 2024

d0h! feel free to leave a comment on Youtube to notify folks about this.

@gforsyth
Copy link
Member Author

Not at all, thanks for bringing it to our attention!

@koaning
Copy link

koaning commented Apr 12, 2024

Since I have you here, any comments on my sklearn predictions observation? Is there an easy way to add a column with predictions from a scikit-learn model in ibis? My initial impression was "no" but I'll gladly be told otherwise.

@gforsyth
Copy link
Member Author

Yes, a few!

For the range example (which is obviously not your end goal with sklearn predictions) you can use ibis.row_number()

For the larger problem of what we call positional joins, it's tricky because pandas and other in-memory formats have an implicit ordering they can take advantage of.

So something slightly gross you can do is:

t.mutate(id=ibis.row_number()).join(ibis.memtable({"id": ..., "predictions": ...}, "id")

where you would've had to make sure you assign the row numbers before hand so you have the join key to relink it afterwards.

You should also check out our https://github.com/ibis-project/ibisml where we are thinking about these issues.

And if you're game, come join our Zulip! We're usually around on there and it works well for semi-synchronous discussions!

https://ibis-project.zulipchat.com/join/o34akeq2pcxoplvgn4ag7wtk/

@koaning
Copy link

koaning commented Apr 12, 2024

Ah! Hadn't thought of it that way, but this memtable approach makes sense. It's a small bummer that it requires a (expensive?) join operation but I can see how this is stable across backends.

Final question, I'm currently hosting and planning a bunch of podcast episodes for this new podcast that we're doing over on the probabl side. If you happen to know someone from the ibis project that would make for a solid guest on the podcast ... do let me know!

@cpcloud
Copy link
Member

cpcloud commented Apr 12, 2024

👋🏻 Hi @koaning I'd be happy to go on the podcast! Thanks for reaching out. Perhaps let's discuss on Zulip in a DM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation related issues or PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants