File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ from typing import (
11
11
12
12
from matplotlib .colors import Colormap
13
13
import numpy as np
14
+ from pandas import Index
14
15
from pandas .core .frame import DataFrame
15
16
from pandas .core .series import Series
16
17
@@ -52,6 +53,10 @@ class _DataFrameFunc(Protocol):
52
53
) -> npt .NDArray | DataFrame : ...
53
54
54
55
class Styler (StylerRenderer ):
56
+ @property
57
+ def columns (self ) -> Index [Any ]: ...
58
+ @property
59
+ def index (self ) -> Index [Any ]: ...
55
60
def __init__ (
56
61
self ,
57
62
data : DataFrame | Series ,
Original file line number Diff line number Diff line change 13
13
import numpy .typing as npt
14
14
from pandas import (
15
15
DataFrame ,
16
+ Index ,
16
17
Series ,
17
18
)
18
19
from pandas ._testing import ensure_clean
@@ -224,3 +225,9 @@ def test_subset() -> None:
224
225
check (assert_type (DF .style .highlight_min (subset = IndexSlice [1 :2 ]), Styler ), Styler )
225
226
check (assert_type (DF .style .highlight_min (subset = [1 ]), Styler ), Styler )
226
227
check (assert_type (DF .style .highlight_min (subset = DF .columns [1 :]), Styler ), Styler )
228
+
229
+
230
+ def test_styler_columns_and_index () -> None :
231
+ styler = DF .style
232
+ check (assert_type (styler .columns , Index ), Index )
233
+ check (assert_type (styler .index , Index ), Index )
You can’t perform that action at this time.
0 commit comments