ENH: add way to check for sparse data (#26706)
- [X] closes #26706 
- [x] tests added / passed
- [X] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry
