How to find MAPE metric in Python?



Can anyone help me with a code to find out MAPE in python ?
I am beginner in python and i cannot find any inbuilt function for that.So can anyone help me with any code ?
I tried this link but its not working its giving an error

@Lesaffrea @hinduja1234 @aayushmnit @Aarshay


Posting the actual error message would help. Regardless, the code is missing an import statement at the beginning. Add the following line to the file: import numpy as np

And of course, you will need to have both scikit-learn and numpy installed for this to work. You can also write your own code since the metric is very simple: Mean absolute percentage error


Adding to @caiotaniguchi, you could also refer here (It has sample implementations too)