I was recently asked how to do an if-test in pandas, that is, how to create an array of 1s and 0s depending on a condition, e.g., if val less than 0.5 -> 0, else -> 1. Using the boolean mask, that's pretty simple since True and False are integers after all.