ENH: add ignore_index option in DataFrame.explode
State: closed

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


Labels:
name: Enhancement
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Note that I'm trying to push a commit for the doc strings, but I can't get passed the pre-commit because of `error: unused 'type: ignore' comment`.
> but I can't get passed the pre-commit because of error: unused 'type: ignore' comment.

You can use `git commit --no-verify`. Sometimes mypy struggles with partial diffs.
@TomAugspurger added the changes you requested for `DataFrame.explod` and `Series.explode`, will look into release note in 1.1.0.rst and tests. Not really familiar with this so will try myself first,but if I need help can I ask you some questions?
Yep. There should be examples you can base yours off of.

For the release note, this can go in the "Other enhancements" section.

On Mon, Jun 22, 2020 at 8:51 AM Erfan Nariman <notifications@github.com>
wrote:

> @TomAugspurger <https://github.com/TomAugspurger> added the changes you
> requested for DataFrame.explod and Series.explode, will look into release
> note in 1.1.0.rst and tests. Not really familiar with this so will try
> myself first,but if I need help can I ask you some questions?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/34933#issuecomment-647531728>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAKAOIX5QIOYWE3KHDUEXETRX5OPTANCNFSM4OEPYUXA>
> .
>

@TomAugspurger I think I added all the requests you had, will check the merge conflict, not sure how this could happen.
The new test fails because of differences in types:

```python
def test_ignore_index():
        # GH 34932
        s = pd.Series([[1, 2], [3, 4]])
        result = s.explode(ignore_index=True)
        expected = pd.Series([1, 2, 3, 4], index=[0, 1, 2, 3])
>       tm.assert_series_equal(result, expected)
E       AssertionError: Attributes of Series are different
E       
E       Attribute "dtype" are different
E       [left]:  object
E       [right]: int64
```
@TomAugspurger @jorisvandenbossche I think I made all the changes you guys requested, if there's anything more I can do, please let me know. 
@jorisvandenbossche @TomAugspurger looks like some tests failed because github was down, is there a way to run the tests again?
Triggered a rerun.

On Mon, Jun 22, 2020 at 3:31 PM Erfan Nariman <notifications@github.com>
wrote:

> @jorisvandenbossche <https://github.com/jorisvandenbossche> @TomAugspurger
> <https://github.com/TomAugspurger> looks like some tests failed because
> github was down, is there a way to run the tests again?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/34933#issuecomment-647754107>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAKAOIVNNTVLVDG6LW2LFZTRX65RHANCNFSM4OEPYUXA>
> .
>

> Triggered a rerun.
> […](#)
> On Mon, Jun 22, 2020 at 3:31 PM Erfan Nariman ***@***.***> wrote: @jorisvandenbossche <https://github.com/jorisvandenbossche> @TomAugspurger <https://github.com/TomAugspurger> looks like some tests failed because github was down, is there a way to run the tests again? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <[#34933 (comment)](https://github.com/pandas-dev/pandas/pull/34933#issuecomment-647754107)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAKAOIVNNTVLVDG6LW2LFZTRX65RHANCNFSM4OEPYUXA> .

Thank you, seems like this one is ready to merge.
@erfannariman can you push the changes you made?
Not sure why this change should trigger `tests/tseries/offsets/test_offsets_properties.test_on_offset_implementations` to fail.
if you can make that change and merge master can get this in
> if you can make that change and merge master can get this in

I think I made all the changes you requested, is there anything else you would like me to do?
The check that fails seems to happen because of merging master, `libreduction` is now unused in `core/apply.py`.
thanks @erfannariman very nice
thanks for reviewing and helping @jreback