Does Python have a function like matlab's
No, it doesn't. You can write your own (whicn isn't difficult), but if you are using Python to fulfil some of matlab's functionality then you definitely want to install
numpy, which has
You may find NumPy for Matlab users informative.