COMPAT: float() exception type for py310
`float()` raises TypeError in py310

```
________________ TestEnsureNumeric.test_non_convertable_values _________________

self = <pandas.tests.test_nanops.TestEnsureNumeric object at 0x7f7da1e029e0>

    def test_non_convertable_values(self):
        msg = "Could not convert foo to numeric"
        with pytest.raises(TypeError, match=msg):
            nanops._ensure_numeric("foo")
    
        # with the wrong type, python raises TypeError for us
        msg = "argument must be a string or a number"
        with pytest.raises(TypeError, match=msg):
>           nanops._ensure_numeric({})

pandas/tests/test_nanops.py:771: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

x = {}

    def _ensure_numeric(x):
        if isinstance(x, np.ndarray):
            if is_integer_dtype(x) or is_bool_dtype(x):
                x = x.astype(np.float64)
            elif is_object_dtype(x):
                try:
                    x = x.astype(np.complex128)
                except (TypeError, ValueError):
                    try:
                        x = x.astype(np.float64)
                    except (TypeError, ValueError) as err:
                        # GH#29941 we get here with object arrays containing strs
                        raise TypeError(f"Could not convert {x} to numeric") from err
                else:
                    if not np.any(np.imag(x)):
                        x = x.real
        elif not (is_float(x) or is_integer(x) or is_complex(x)):
            try:
>               x = float(x)
E               TypeError: float() argument must be a string or a real number, not 'dict'

pandas/core/nanops.py:1600: TypeError
```