From e3bf6ee11f4e11b1cb1888b8bdce1df4084a625e Mon Sep 17 00:00:00 2001 From: Ziheng Date: Wed, 17 Sep 2025 20:54:51 +1000 Subject: [PATCH 1/2] doc: Added iloc dtype conversion behaviours --- pandas/core/indexing.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 776356abc71d6..9fae4d822c04b 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -182,6 +182,10 @@ def iloc(self) -> _iLocIndexer: ``.iloc`` will raise ``IndexError`` if a requested indexer is out-of-bounds, except *slice* indexers which allow out-of-bounds indexing (this conforms with python/numpy *slice* semantics). + + It is also worth noting, iloc converts all elements returned into the same + pandas dtype and all numeric dtype conversions follow the numpy promotion + rules. See more at :ref:`Selection by Position `. From 110dc1c2d8faac505d2dce4a008f5d7f0854feb8 Mon Sep 17 00:00:00 2001 From: Ziheng Date: Wed, 17 Sep 2025 21:04:34 +1000 Subject: [PATCH 2/2] doc: Fixed space formatting on indexing.py --- pandas/core/indexing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index dbfecea172602..582bdfef2f750 100644 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -186,9 +186,9 @@ def iloc(self) -> _iLocIndexer: ``.iloc`` will raise ``IndexError`` if a requested indexer is out-of-bounds, except *slice* indexers which allow out-of-bounds indexing (this conforms with python/numpy *slice* semantics). - - It is also worth noting, iloc converts all elements returned into the same - pandas dtype and all numeric dtype conversions follow the numpy promotion + + It is also worth noting, iloc converts all elements returned into the same + pandas dtype and all numeric dtype conversions follow the numpy promotion rules. See more at :ref:`Selection by Position `.