BUG: rolling.count with axis=1 
State: closed

- [ ] closes #13503 
- [X] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry
Added axis parameter to the constructor call in the count function, fixing the original issue in #13503. This fix works for the example given in the issue. This does not fix the problem addressed by jorisvandenbossche, as that seems to be a type issue.


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

Comments:
tests pls
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=h1) Report
> Merging [#26055](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/a07ed594ec6a5befc967fb1b18244bbeb3bc2bf1?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26055/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26055      +/-   ##
==========================================
- Coverage    91.9%   91.89%   -0.01%     
==========================================
  Files         175      175              
  Lines       52485    52485              
==========================================
- Hits        48234    48231       -3     
- Misses       4251     4254       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.45% <ø> (ø)` | :arrow_up: |
| #single | `40.75% <ø> (-0.14%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.39% <ø> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `75% <0%> (-12.5%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.79% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.72% <0%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=footer). Last update [a07ed59...da47224](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=h1) Report
> Merging [#26055](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/fecee8ffe39446d213f425257c6de24b5a7f9021?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26055/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26055      +/-   ##
==========================================
- Coverage   91.98%   91.97%   -0.02%     
==========================================
  Files         175      175              
  Lines       52371    52379       +8     
==========================================
  Hits        48175    48175              
- Misses       4196     4204       +8
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.52% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.69% <ø> (-0.16%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/window.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvd2luZG93LnB5) | `96.39% <ø> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `90.53% <0%> (-0.35%)` | :arrow_down: |
| [pandas/core/computation/engines.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tcHV0YXRpb24vZW5naW5lcy5weQ==) | `88.33% <0%> (-0.2%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.9% <0%> (-0.12%)` | :arrow_down: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.94% <0%> (-0.06%)` | :arrow_down: |
| [pandas/core/reshape/pivot.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzaGFwZS9waXZvdC5weQ==) | `96.54% <0%> (ø)` | :arrow_up: |
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.08% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexes/interval.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9pbnRlcnZhbC5weQ==) | `95.22% <0%> (ø)` | :arrow_up: |
| [pandas/core/sparse/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc3BhcnNlL3Nlcmllcy5weQ==) | `93.3% <0%> (ø)` | :arrow_up: |
| ... and [22 more](https://codecov.io/gh/pandas-dev/pandas/pull/26055/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=footer). Last update [fecee8f...d040376](https://codecov.io/gh/pandas-dev/pandas/pull/26055?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Hello @yhaque1213! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2019-04-26 18:51:18 UTC
@gfyoung 
I updated the tests to replace my calls to `assert_equal` with `tm.assert_frame_equal`, and I also modified it to pass pep8 checks. My initial changes to fix the issue, without any tests, was passing all of the builds.

Once I added my tests, however, I started failing pandas-dev.pandas and pandas-dev.pandas (Linux py35_compat), and I'm having some trouble figuring out what's causing this to happen.

More specifically, it seems to be an error with the `test_drop_duplicates_categorical_non_bool` in `pandas/tests/series/test_analytics.py`, but I have no idea why this specific test would be failing because of adding my test, `test_count_axis`. 

Do you have any advice?

@yhaque1213 : Have you merged / rebased onto the most recent `master`?  Try that and see if it goes away.  Otherwise, we'll look into seeing if we can remove (or weaken) the `xfail` on those tests.
@gfyoung : that seemed to do the trick - my latest update is passing all of the checks. Thank you, and please let me know if there's anything else you'd like me to add!
@yhaque1213 : Don't forget the `whatsnew` entry!
I made the changes to the test and to the docs, but it seems like these Azure pipelines checks are passing arbitrarily. For instance, after fixing a typo in a comment (commit #12065b6) we passed 10/10 tests, while the previous commit only passed 8 (commit #41ae7fe). This happened even with rebasing before each push, therefore, we aren't sure what to change for this last commit to get it to pass all 10. 
> I made the changes to the test and to the docs, but it seems like these Azure pipelines checks are passing arbitrarily. For instance, after fixing a typo in a comment (commit #12065b6) we passed 10/10 tests, while the previous commit only passed 8 (commit #41ae7fe). This happened even with rebasing before each push, therefore, we aren't sure what to change for this last commit to get it to pass all 10.

CI is not 'arbitrary', rather there was an upstream change that broke things.
pls merge master and ping on green.
@jreback : Just made the changes requested, and I'm passing all the checks now!
I've made all of the changes that were requested, but I'm still having trouble getting all of the checks to pass. I've tried rebasing and merging multiple times, but nothing has been working
try

git merge upstream/master
There's a failure in the doc checks that should be unrelated. Not sure if its a versioning thing or a commit to master. Taking a look now
this was cleared yesterday 
Latest push was with merging with upstream/master, but it looks like the checks are still failing in the same ways as before. Sorry I'm not sure if I'm doing something wrong, but I've tried everything I could think of
small typo plus can i merge master ; ping on green
@jrebeck: I removed the typo - I'm passing all the checks now!
thanks @yhaque1213