ENH: add ignore index to DataFrame / Series.sample
- [x] closes #38581
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry

Picking up #38594. Left in 1.3 for now since all comments were addressed except small typing issues and seems like a nice enhancement, but let me know if it should be moved.
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.3.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 902be0267dfe3c2ec9263a92919ed0c2cca7ce18
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #42168: ENH: add ignore index to DataFrame / Series.sample'
```

4. Push to a named branch :

```
git push YOURFORK 1.3.x:auto-backport-of-pr-42168-on-1.3.x
```

5. Create a PR against branch 1.3.x, I would have named this PR:

> "Backport PR #42168 on branch 1.3.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                 thanks @mzeitlin11 and @erfannariman for the original! cc @meeseeksdev backport 1.3.x Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.3.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 902be0267dfe3c2ec9263a92919ed0c2cca7ce18
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #42168: ENH: add ignore index to DataFrame / Series.sample'
```

4. Push to a named branch :

```
git push YOURFORK 1.3.x:auto-backport-of-pr-42168-on-1.3.x
```

5. Create a PR against branch 1.3.x, I would have named this PR:

> "Backport PR #42168 on branch 1.3.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                 @mzeitlin11 looks like a conflict on 1.3 if you do a manual PR (cc @simonjayhawkins) > @mzeitlin11 looks like a conflict on 1.3 if you do a manual PR (cc @simonjayhawkins)

Yep I can take care of it later today