ENH: use numpy operations where possible