1 Resposta
+ 4
math is a standard library that provides a number of functions (trigonometry, logarithms) and constants.
numpy is a different league. It is a mathematical library written in C. The major object of numpy is a homogenenous multidimensional array, the ndarray.
This array allows to perform mathematical operations on the whole array (or columns, rows) without looping over the elements. Moreover, ndarrays can be multiplied (other fundamental operations work as well) even if the dimensions of the arrays aren't identical. More often than not, the smaller array is automatically enlarged (by duplicating rows or columns) to make these calculations possible.
In short, numpy is very powerful and blazingly fast. In addition, it is the fundament of the data analysis library pandas.