DOC: fixes pipe example in basics.rst due to statsmodel changes
To work around changes in statsmodel api.

- [ ] closes #19713
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry