Becky
Becky

Reputation: 201

MATLAB 'fit' function for Python

I am trying to look for a Python function that is the same as MATLAB's 'fit' function.

Specifically I am looking for something similar to the following MATLAB code:

fi = fit(bins, z, cubicinterp) 

where z and bins are lists.

Upvotes: 2

Views: 4587

Answers (2)

Shaun314
Shaun314

Reputation: 3461

Honestly, I think there are hundreds of Python functions to do exactly what you want (and much more).

Here is one example using NumPy, but seriously, just google it and you will be amazed:

numpy.polyfit

Upvotes: 1

Bitwise
Bitwise

Reputation: 7805

Try SciPy's curve_fit() for general fitting of a function.

For specific interpolations, have a look at SciPy's interploation functions.

Upvotes: 4

Related Questions