Modules & imports

Python’s power comes from its libraries. import brings them in; the data world runs on numpy and pandas.

`import math` then use `math.sqrt(9)`. `from math import sqrt` imports just that name. Data code aliases libraries: `import numpy as np`, `import pandas as pd`.

import math
print(math.sqrt(16))   # 4.0

import numpy as np      # np is the standard alias

More lessons in Python for data