Skip to content

Commit 68f6e7a

Browse files
committed
fix errors
1 parent 5cc3861 commit 68f6e7a

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

doc/source/whatsnew/v0.23.0.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -861,21 +861,21 @@ Previous behavior:
861861
862862
Current behavior:
863863

864-
.. ipython:: python
864+
.. code-block:: ipython
865865
866-
index = pd.Int64Index([-1, 0, 1])
866+
In [12]: index = pd.Int64Index([-1, 0, 1])
867867
# division by zero gives -infinity where negative,
868868
# +infinity where positive, and NaN for 0 / 0
869-
index / 0
869+
In [13]: index / 0
870870
871871
# The result of division by zero should not depend on
872872
# whether the zero is int or float
873-
index / 0.0
873+
In [14]: index / 0.0
874874
875-
index = pd.UInt64Index([0, 1])
876-
index / np.array([0, 0], dtype=np.uint64)
875+
In [15]: index = pd.UInt64Index([0, 1])
876+
In [16]: index / np.array([0, 0], dtype=np.uint64)
877877
878-
pd.RangeIndex(1, 5) / 0
878+
In [17]: pd.RangeIndex(1, 5) / 0
879879
880880
.. _whatsnew_0230.api_breaking.extract:
881881

doc/source/whatsnew/v0.25.0.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,12 @@ considered commutative, such that ``A.union(B) == B.union(A)`` (:issue:`23525`).
473473
474474
*New behavior*:
475475

476-
.. ipython:: python
476+
.. code-block:: python
477477
478-
pd.period_range('19910905', periods=2).union(pd.Int64Index([1, 2, 3]))
479-
pd.Index([], dtype=object).union(pd.Index([1, 2, 3]))
478+
In [3]: pd.period_range('19910905', periods=2).union(pd.Int64Index([1, 2, 3]))
479+
Out[3]: Index([1991-09-05, 1991-09-06, 1, 2, 3], dtype='object')
480+
In [4]: pd.Index([], dtype=object).union(pd.Index([1, 2, 3]))
481+
Out[4]: Index([1, 2, 3], dtype='object')
480482
481483
Note that integer- and floating-dtype indexes are considered "compatible". The integer
482484
values are coerced to floating point, which may result in loss of precision. See

pandas/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@
7171
# indexes
7272
Index,
7373
CategoricalIndex,
74-
UInt64Index,
7574
RangeIndex,
76-
Float64Index,
7775
NumericIndex,
7876
MultiIndex,
7977
IntervalIndex,
@@ -186,19 +184,19 @@
186184

187185

188186
# GH 27101
189-
deprecated_num_index_names = ["Float64Index", "Int64Index", "UInt64Index"]
187+
__deprecated_num_index_names = ["Float64Index", "Int64Index", "UInt64Index"]
190188

191189

192190
def __dir__():
193-
return list(globals().keys()) + deprecated_num_index_names
191+
return list(globals().keys()) + __deprecated_num_index_names
194192

195193

196194
def __getattr__(name):
197195
import warnings
198196

199-
if name in deprecated_num_index_names:
197+
if name in __deprecated_num_index_names:
200198
num_msg = (
201-
f"The pandas.{name} class is deprecated "
199+
f"pandas.{name} is deprecated "
202200
"and will be removed from pandas in a future version. "
203201
"Use pandas.NumericIndex with the appropriate dtype instead."
204202
)
@@ -207,7 +205,7 @@ def __getattr__(name):
207205

208206
warnings.warn(num_msg, FutureWarning, stacklevel=2)
209207
return Int64Index
210-
elif name == "Unt64Index":
208+
elif name == "UInt64Index":
211209
from pandas.core.api import UInt64Index
212210

213211
warnings.warn(num_msg, FutureWarning, stacklevel=2)

pandas/tests/api/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class TestPDApi(Base):
100100
]
101101

102102
# these are already deprecated; awaiting removal
103-
deprecated_classes: list[str] = []
103+
deprecated_classes: list[str] = ["Float64Index", "Int64Index", "UInt64Index"]
104104

105105
# these should be deprecated in the future
106106
deprecated_classes_in_future: list[str] = ["SparseArray"]

0 commit comments

Comments
 (0)