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 Series.cut/6 and Series.qcut/6 #629

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

anthony-khong
Copy link
Contributor

Hi @josevalim and @philss. I completely understand if you may not want to merge this, but I've given it a good go, and I thought I might as well submit a PR.

I've been eyeing these functions just because they're quite useful for exploratory data analysis and feature engineering - it's based on cut and qcut.

A couple of reason why we may not want to merge this:

  1. Requires a new dependency polars-algo in Cargo.toml. I'm honestly not sure what the implication of this is - bloating the NIFs perhaps?
  2. qcut is still experimental in Polars but also perhaps worth mentioning that it's been in Pandas for four years.

iex> Explorer.Series.cut(s, [1.5, 2.5])
#Explorer.DataFrame<
Polars[3 x 3]
float [1.0, 2.0, 3.0]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
float [1.0, 2.0, 3.0]
float [1.0, 2.0, 3.0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes the doctest fail. I think it's because it's a column named with an empty string due to this.

I'll rename it to values.

@anthony-khong
Copy link
Contributor Author

Since José approved the changes, I'll mark this PR as ready for review. Cheers!

@anthony-khong anthony-khong marked this pull request as ready for review June 28, 2023 03:23
@josevalim josevalim merged commit 3c61262 into elixir-explorer:main Jun 28, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@anthony-khong anthony-khong deleted the cut-qcut branch June 29, 2023 10:59
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.

2 participants