Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1fb0adb
[skip ci] pdep6 draft
Dec 22, 2022
5456787
[skip ci] reword
Dec 24, 2022
02ff735
[skip ci] compare with DataFrames.jl
Dec 24, 2022
e3cc381
[skip ci] note about loss of precision
Dec 24, 2022
f6298e9
[skip ci] add examples of operations which would raise
Dec 30, 2022
dffef42
[skip ci] note about DataFrame.__setitem__
Dec 30, 2022
9fa7675
[skip ci] notes about dataframe case
Dec 30, 2022
2ce6ff0
[skip ci] remove special-casing of full slice
Jan 3, 2023
4626831
[skip ci] minor fixups
Jan 3, 2023
1217a4e
[skip ci] add examples with boolean masks
Jan 3, 2023
6798a2d
[skip ci] Merge remote-tracking branch 'upstream/main' into pdep6
Jan 13, 2023
a930df1
use more generic indexer in example, clarify the enlargement is out o…
Mar 17, 2023
02bab00
dont call workaround "easy"
Mar 20, 2023
875cf4c
define indexer
Mar 20, 2023
9dcf8d4
clarify
Mar 24, 2023
d15a7c1
wip
Mar 24, 2023
2c214c7
split up examples, assorted cleanups, clarify scope
Mar 24, 2023
1868f3c
mention df.index.intersection
Mar 30, 2023
80841d2
make explicit that option 1 was chosen in this pdep
Apr 6, 2023
0c4bdff
clarify option 3
MarcoGorelli Apr 6, 2023
e6f0c7f
clarify option 2
MarcoGorelli Apr 6, 2023
368ad20
correct "risk annoy" to "risk annoying" so as to not risk annoying re…
MarcoGorelli Apr 6, 2023
35c3f37
Merge remote-tracking branch 'upstream/main' into pdep6
Apr 7, 2023
a0ae1fd
add faq
Apr 8, 2023
af7e0e4
Merge remote-tracking branch 'upstream/main' into pdep6
Apr 9, 2023
a002831
Merge branch 'pdep6' of github.com:MarcoGorelli/pandas into pdep6
Apr 9, 2023
3e220f0
add example with 16.000000000000001 to faq
Apr 11, 2023
0b02317
minor clarification (when constructing it)
Apr 11, 2023
50f0a41
Update web/pandas/pdeps/0006-ban-upcasting.md
MarcoGorelli Apr 11, 2023
cc77562
add example of maybe_convert_to_int function
Apr 11, 2023
9cee2c7
Merge branch 'pdep6' of github.com:MarcoGorelli/pandas into pdep6
Apr 11, 2023
0ff14f1
Merge remote-tracking branch 'upstream/main' into pdep6
Apr 21, 2023
8211f37
change status to accepted
Apr 21, 2023
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
Prev Previous commit
Next Next commit
[skip ci] note about loss of precision
  • Loading branch information
MarcoGorelli committed Dec 24, 2022
commit e3cc381e396e6fcf9085ac5d1d17df4b40ec89dd
13 changes: 8 additions & 5 deletions web/pandas/pdeps/0006-ban-upcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,14 @@ Option ``2`` would be a breaking behaviour change in pandas. Further,
if the objective of this PDEP is to prevent bugs, then this is also not desirable:
someone might set ``1.5`` and later be surprised to learn that they actually set ``1``.

Option ``3`` would be inconsistent with the nullable dtypes' behaviour. It would also add
complexity to the codebase and to tests. It would be hard to teach, as instead of
being able to teach a simple rule, there would be a rule with exceptions. Finally, it opens
the door to other exceptions, such as not upcasting to ``'int16'`` when trying to set an
element of a ``'int8'`` ``Series`` to ``128``.
There are several downsides to option ``3``:
- it would be inconsistent with the nullable dtypes' behaviour;
- it would also add complexity to the codebase and to tests;
- it would be hard to teach, as instead of being able to teach a simple rule,
there would be a rule with exceptions;
- there would be a risk of loss of precision;
- it opens the door to other exceptions, such as not upcasting to ``'int16'``
when trying to set an element of a ``'int8'`` ``Series`` to ``128``.

Option ``1`` is the maximally safe one in terms of protecting users from bugs, being
consistent with the current behaviour of nullable dtypes, and in being simple to teach.
Expand Down