keepdims only exists in numpy 1.7+