New Columns from Old: Math, np.where and cut
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.
Updated

- Category
- Data Analysis
- Level
- Journeyman
- Tags
- apply(), cut, Lambda Function, np.where(), python