BUG: GH12902 fixed coercion of complex values to float when using gro…
- [x] closes #12902  
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry

thanks!
