def _assert_can_do_op(self, value):
        if not lib.isscalar(value):
            msg = "'value' must be a scalar, passed: {0}"
            raise TypeError(msg.format(type(value).__name__))
Check value is valid for scalar op
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index._assert_can_do_op