File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ from typing import (
1111
1212from matplotlib .colors import Colormap
1313import numpy as np
14+ from pandas import Index
1415from pandas .core .frame import DataFrame
1516from pandas .core .series import Series
1617
@@ -52,6 +53,10 @@ class _DataFrameFunc(Protocol):
5253 ) -> npt .NDArray | DataFrame : ...
5354
5455class Styler (StylerRenderer ):
56+ @property
57+ def columns (self ) -> Index [Any ]: ...
58+ @property
59+ def index (self ) -> Index [Any ]: ...
5560 def __init__ (
5661 self ,
5762 data : DataFrame | Series ,
Original file line number Diff line number Diff line change 1313import numpy .typing as npt
1414from pandas import (
1515 DataFrame ,
16+ Index ,
1617 Series ,
1718)
1819from pandas ._testing import ensure_clean
@@ -224,3 +225,9 @@ def test_subset() -> None:
224225 check (assert_type (DF .style .highlight_min (subset = IndexSlice [1 :2 ]), Styler ), Styler )
225226 check (assert_type (DF .style .highlight_min (subset = [1 ]), Styler ), Styler )
226227 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