Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7bef135
doctest fix for #42671
Jul 25, 2021
cc55377
doctest fix for #42671(added format.py to doctest scripts)
Jul 25, 2021
e7a5a91
doctest fix for #42670
Jul 26, 2021
170cc45
doctest fix for #42670 (whitespace removal)
Jul 26, 2021
fad0bab
doctest fix for #42670
Jul 26, 2021
a340b16
doctest fix for #42670 (reverted formatting changes pycharm auto form…
Jul 26, 2021
93d5565
doctest fix for #42670
Jul 27, 2021
314aee5
Merge branch 'master' into doctest-fix-2
KrishnaSai2020 Jul 27, 2021
3074c66
doctest fix for #42670
Jul 27, 2021
f5756ce
doctest fix for #42670
Jul 27, 2021
2ddfc4c
doctest fix for #42670 + EngFormatter code fix
Jul 27, 2021
eb44c51
doctest fix for #42670
Jul 27, 2021
8f8763e
doctest fix for #42670 linting
Jul 27, 2021
2ab00ac
doctest fix for #42670
Jul 27, 2021
1a08c3e
doctest fix for #42670
Jul 27, 2021
9543b90
Update format.py
KrishnaSai2020 Jul 27, 2021
5b1d96f
Update format.py
KrishnaSai2020 Jul 27, 2021
98cab71
Update format.py
KrishnaSai2020 Jul 27, 2021
e79d33c
.
Jul 27, 2021
a966c3b
Merge branch 'master' into doctest-fix-2
Jul 27, 2021
9608782
made requested changes
Jul 27, 2021
96b447d
Merge https://github.com/pandas-dev/pandas into doctest-fix-2
Jul 28, 2021
8ec062d
Merge branch 'master' into doctest-fix-2
KrishnaSai2020 Jul 29, 2021
e898934
Update code_checks.sh
KrishnaSai2020 Jul 29, 2021
d4b326b
Merge branch 'pandas-dev:master' into doctest-fix-2
KrishnaSai2020 Jul 29, 2021
4899867
Merge branch 'pandas-dev:master' into doctest-fix-2
KrishnaSai2020 Jul 30, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
pandas/io/parsers/ \
pandas/io/sas/ \
pandas/io/sql.py \
pandas/io/formats/format.py \
pandas/tseries/
RET=$(($RET + $?)) ; echo $MSG "DONE"

Expand Down
14 changes: 6 additions & 8 deletions pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,16 +1956,14 @@ def __call__(self, num: int | float) -> str:
"""
Formats a number in engineering notation, appending a letter
representing the power of 1000 of the original number. Some examples:

>>> format_eng(0) # for self.accuracy = 0
>>> format_eng = EngFormatter(accuracy=0, use_eng_prefix=True)
>>> format_eng(0)
' 0'

>>> format_eng(1000000) # for self.accuracy = 1,
# self.use_eng_prefix = True
>>> format_eng = EngFormatter(accuracy=1, use_eng_prefix=True)
>>> format_eng(1_000_000)
' 1.0M'

>>> format_eng("-1e-6") # for self.accuracy = 2
# self.use_eng_prefix = False
>>> format_eng = EngFormatter(accuracy=2, use_eng_prefix=False)
>>> format_eng("-1e-6")
'-1.00E-06'

@param num: the value to represent
Expand Down