Due to its high performance nature, scientific computing in Python often utilizes external libraries, typically written in faster languages (like C, or FORTRAN for matrix operations).
À verifier : performance There are several ways of doing so in Python: there is no performance difference between the different approaches.
import math
:import math
print(math.factorial(10))
3628800
import math as m
:m
stands for math
. The math library functions can be called using the library alias: m.factorial(number) instead of math.factorial(number).
import math as m
print(m.factorial(10))
3628800
from math import *
The entire library name space is imported: you can directly use factorial() without referring to math.
from math import *
print(factorial(10))
3628800
from math import factorial
print(factorial(10))
3628800
Google recommends that you use first approach to import libraries (
import math
), as you will know where the functions come from while calling them (math.function_name()
instead of `function_name())
Moreover, importing a function into the global namespace risks name collisions if you use two different libraries having the same function mame.
from https://www.analyticsvidhya.com/blog/2016/01/completetutoriallearndatasciencepythonscratch2/
The four main libraries used for datascience computing are NumPy, SciPy, Matplotlib and Pandas.
LIBRARY  FEATURES 

NumPy (Numerical Python) 

SciPy (Scientific Python) 

Matplotlib 

Pandas 

OTHER LIBRARIES  FEATURES 

Scikit Learn 

Statsmodels 

Seaborn 

Bokeh 

Blaze 

Scrapy 

SymPy (symbolic computation) 

Requests 
for accessing the web, similar to the standard python library urllib2 but easier to code 
os 
for Operating system and file operations 
networkx and igraph 
for graph 
regular expressions 
to find patterns in text data 
BeautifulSoup 
for scrapping web, extract information from just a single webpage in a run 