TST: fixed eng_formatter doctest for #42671
State: closed

- [x] closes #42671
- [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] fixed the doctest error in the docs for format.py


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Docs

Comments:
I'm quite confused as to why these CI checks failed/were cancelled. can someone help me with this?
> I'm quite confused as to why these CI checks failed/were cancelled. can someone help me with this?

The windows build timed out. It happens sometimes. And it's unrelated to this PR.
This fixed one doctest error in that file but I don't know about the whole directory. so I added just the file itself.
Thanks @KrishnaSai2020. This doctest is still failing in the file, do you want to fix it here too?

`FAILED pandas/io/formats/format.py::pandas.io.formats.format.EngFormatter.__call__`
@datapythonista I am quite confused as this pr is fixing that particular doctest are you saying the fix doesn't work?
> @datapythonista I am quite confused as this pr is fixing that particular doctest are you saying the fix doesn't work?

You fixed one method docstring, that's fine. And then you're validating the doctests of the file where you fixed the docstring. The problem is that the file has many other methods, and most of them pass the tests, but the one I mentioned above is failing.

So, we have two options:
- You don't validate the file, since not all doctests in it are passing. There were two broken, afyer your PR there is one broken
- You leave the validation of the file, but besidea the doctest that you fixed, you fix the other brokem one too
I don't mind fixing the other docstrings as well but the reason I was confused is you have mentioned the same one 
`pandas/io/formats/format.py::pandas.io.formats.format.EngFormatter.__call__` is the same function that this pr resolves. 
True, I assumed it was a different one. Your fix is not working, there are other problems in the docstring. You should run the doctests locally to make sure it's fixed. This is the error (the first one, of there is more than one): https://github.com/pandas-dev/pandas/pull/42705/checks?check_run_id=3154916570#step:9:102
I am trying to run the doctests locally but I am getting a whole swathe of unrelated errors on pycharm such as `  File "/Users/krishnachivukula/Documents/pandas/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
ModuleNotFoundError: No module named 'pandas._libs.interval'` . Anyways on a more relevant note, there was an issue fundamentally with the class itself which I have now hopefully have fixed. formatting 0 should just return 0, not 0E+00 which was overlooked.
Hello @KrishnaSai2020! 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 2021-07-30 08:16:27 UTC
@datapythonista sorry for the spam of commits pycharm decided to autoformat the whole file for me and I had to roll back the changes.
`1963         >>> format_eng(1000000) # for self.accuracy = 1,
Expected:
                            #     self.use_eng_prefix = True
    ' 1.0M'
Got:
    ' 1E+06'`
this to me suggests an error with the eng formatter code itself unrelated to the docstring. should I open an issue?
@datapythonista Thanks for your patience. I believe I have now fixed all the issues let me know if find anything else on this file.
@datapythonista Made the changes with formatting and could you please check that I merged the master branch into this one correctly?
@datapythonista sorry to bother you again! I committed the changes please review.
@datapythonista no problem and thanks for your help. I will take definitely take a look at the pep8 validation scripts for the docs too at a later time.  
@KrishnaSai2020 if you merge master this should now be green.
@jreback thank you! I have now merged upstream master into this branch.
@datapythonista Could I get an update as to what is going to happen with this pr, please? Is it going to get merged? or have I done something wrong which means it can't get merged?
We need to get the CI green first, otherwise we can't merge. Can you merge master again, see if that fixes the issues, and if not, have a look and see what's the problem. Mostly the CI / Checks build, the others are likely to be unrelated.
I think the issue is with stylerender.py doctests. I've removed them now and let's see what happens. 
I've merged master again and some completely unrelated doctests are still failing.
I created #42798 for it, we'll have to wait for that issue to be fixed, and then merge master again.
@datapythonista all CI/checks have now passed
thanks @KrishnaSai2020