# Calculated Columns

Calculated Columns: New Columns from Old: Math, np.where and cut, NumPy: The Engine Under pandas.

Updated: November 19, 2026

1. [New Columns from Old: Math, np.where and cut](https://www.ask-codey.com/lessons/pandas-calculated-columns) (Journeyman): Math between columns makes a new column for every row at once, np.where picks one of two values for each row from a True or False column, pd.cut sorts numbers into labeled bands such as budget, mid and premium, and apply runs a function of your own on every value, more slowly than whole-column math.
2. [NumPy: The Engine Under pandas](https://www.ask-codey.com/lessons/data-numpy-under-pandas) (Journeyman): NumPy's array holds many values of one type and does math on all of them at once, a vectorized operation that a Python list can't do; every pandas column keeps its values in an array (to_numpy hands it over), np.mean gives NaN when a value is missing where pandas skips it, and one type per column is what makes the math fast.

Source: https://www.ask-codey.com/courses/python-data-analysis/topics/data-calculated-columns
