Mathematical constants and basic operations
pi e Trigonometric function
>>> import numpy as np
>>> np.pi
3.141592653589793
>>> np.e
2.718281828459045
>>> np.sin(np.pi/4)
0.7071067811865476
# Power has priority over division, so there is no need to add parentheses
>>> 2**0.5 / 2
0.7071067811865476
# Euler formula: e^(i*pi)+1=0 numpy can handle complex number operations
>>> np.e ** (0+1j * np.pi)
(-1+1.2246467991473532e-16j)
>>> Statistics
Last updated