Implementing math in python

Due to my educational purposes (in math), I decided to write some programs that will be similar to MATLAB or python libraries (numpy, scipy). There is no attempt to create something new or for any use. I want to understand the mechanisms by implementing them in Python. Can you give any advices on tutorials or resources that will be useful? Or should I just follow the official documentation and trying to remake it?

Thanks a lot.