BUG: constructing a DataFrame using range doesn't work
- [x] closes #26342
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Fixes bug when constructing a ``DataFrame`` using a ``range``.