-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Feature Request: Linear step function (similar to numpy.heaviside) #14314
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
Comments
Thanks for asking @kolibril13. I think that doesn't meet our bar for inclusion in NumPy itself (which is high these days). It's fairly easy to do yourself if you need this, as your code shows. There's many such utility functions we could include, but it would fill up the numpy namespace with things most users may never need. |
ok, thanks! |
I'm starting to wonder whether heaviside met the bar for inclusion, not that that matters now. |
It wouldn't today for sure I think. The bar was a lot lower 10-15 years ago. |
Well, that was only two years ago (gh-8795) |
hmm I totally missed that. I think that was a mistake. |
Well, I cannot talk for any other developers, but, as STEM student, I can tell you it has proven useful quite sometimes. |
Often I use this function:


which is defined as:
So very similar to the numpy heaviside function, but with an linear interval between 0 and 1.
Therefore I wrote the function "linear_step_func".
Is there an interest of making it a numpy function?
The text was updated successfully, but these errors were encountered: