0

I need the functionality of numpy.interp() from python in javascript.

Example - how do i implement this in javascript ?

result = np.interp(5,[0,10],[0,100])
Sundeep Pidugu
  • 2,377
  • 2
  • 21
  • 43
chrisg
  • 85
  • 8
  • What have you tried so far to solve it on your own? – Andreas Oct 29 '19 at 13:47
  • I know that something basic like this would work for now: https://stackoverflow.com/questions/14224535/scaling-between-two-number-ranges I'm just cusiouse, if there is a "proper" numpy-like library, that is also able to do more advanded stuff. – chrisg Oct 29 '19 at 14:02
  • _"if there is a "proper" numpy-like library"_ - Asking for a library (or other off-site resources) is off-topic for SO – Andreas Oct 29 '19 at 14:04

1 Answers1

2

I don't know what numpy.interp() is but I can Google it. Looks like it is:

https://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html

One-dimensional linear interpolation.

Then we Google javascript One-dimensional linear interpolation and the first result is:

http://borischumichev.github.io/everpolate/

Cool! Yeah, I think there are libraries for what you would like to do.

Will
  • 3,201
  • 1
  • 19
  • 17
  • Instead of adding an answer to an off-topic question you should vote to close it -> [What topics can I ask about here?](https://stackoverflow.com/help/on-topic) – Andreas Oct 29 '19 at 14:19