def cast_scalar_indexer(val):
<EOL>if lib.is_float(val) and val == int(val):<EOL><INDENT>return int(val)<EOL><DEDENT>return val<EOL>
To avoid numpy DeprecationWarnings, cast float to integer where valid.

Parameters
----------
val : scalar

Returns
-------
outval : scalar