@@ -19,6 +19,7 @@ from typing import (
19
19
Generic ,
20
20
Literal ,
21
21
NoReturn ,
22
+ final ,
22
23
overload ,
23
24
)
24
25
@@ -705,6 +706,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
705
706
def transpose (self , * args : Any , copy : _bool = ...) -> Self : ...
706
707
@property
707
708
def T (self ) -> Self : ...
709
+ @final
708
710
def __getattr__ (self , name : str ) -> Series : ...
709
711
def isetitem (
710
712
self , loc : int | Sequence [int ], value : Scalar | ArrayLike | list [Any ]
@@ -795,6 +797,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
795
797
allow_duplicates : _bool = ...,
796
798
) -> None : ...
797
799
def assign (self , ** kwargs : IntoColumn ) -> Self : ...
800
+ @final
798
801
def align (
799
802
self ,
800
803
other : NDFrameT ,
@@ -1700,6 +1703,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1700
1703
@property
1701
1704
def values (self ) -> np .ndarray : ...
1702
1705
# methods
1706
+ @final
1703
1707
def abs (self ) -> Self : ...
1704
1708
def add (
1705
1709
self ,
@@ -1708,7 +1712,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1708
1712
level : Level | None = ...,
1709
1713
fill_value : float | None = ...,
1710
1714
) -> Self : ...
1715
+ @final
1711
1716
def add_prefix (self , prefix : _str , axis : Axis | None = None ) -> Self : ...
1717
+ @final
1712
1718
def add_suffix (self , suffix : _str , axis : Axis | None = None ) -> Self : ...
1713
1719
@overload
1714
1720
def all (
@@ -1744,7 +1750,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1744
1750
skipna : _bool = ...,
1745
1751
** kwargs : Any ,
1746
1752
) -> Series [_bool ]: ...
1753
+ @final
1747
1754
def asof (self , where , subset : _str | list [_str ] | None = ...) -> Self : ...
1755
+ @final
1748
1756
def asfreq (
1749
1757
self ,
1750
1758
freq ,
@@ -1753,18 +1761,21 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1753
1761
normalize : _bool = ...,
1754
1762
fill_value : Scalar | None = ...,
1755
1763
) -> Self : ...
1764
+ @final
1756
1765
def astype (
1757
1766
self ,
1758
1767
dtype : AstypeArg | Mapping [Any , Dtype ] | Series ,
1759
1768
copy : _bool = ...,
1760
1769
errors : IgnoreRaise = ...,
1761
1770
) -> Self : ...
1771
+ @final
1762
1772
def at_time (
1763
1773
self ,
1764
1774
time : _str | dt .time ,
1765
1775
asof : _bool = ...,
1766
1776
axis : Axis | None = ...,
1767
1777
) -> Self : ...
1778
+ @final
1768
1779
def between_time (
1769
1780
self ,
1770
1781
start_time : _str | dt .time ,
@@ -1859,6 +1870,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1859
1870
inplace : Literal [True ],
1860
1871
** kwargs : Any ,
1861
1872
) -> None : ...
1873
+ @final
1862
1874
def copy (self , deep : _bool = ...) -> Self : ...
1863
1875
def cummax (
1864
1876
self , axis : Axis | None = ..., skipna : _bool = ..., * args : Any , ** kwargs : Any
@@ -1872,6 +1884,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1872
1884
def cumsum (
1873
1885
self , axis : Axis | None = ..., skipna : _bool = ..., * args : Any , ** kwargs : Any
1874
1886
) -> Self : ...
1887
+ @final
1875
1888
def describe (
1876
1889
self ,
1877
1890
percentiles : list [float ] | None = ...,
@@ -1892,9 +1905,12 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1892
1905
level : Level | None = ...,
1893
1906
fill_value : float | None = ...,
1894
1907
) -> Self : ...
1908
+ @final
1895
1909
def droplevel (self , level : Level | list [Level ], axis : Axis = ...) -> Self : ...
1896
1910
def eq (self , other , axis : Axis = ..., level : Level | None = ...) -> Self : ...
1911
+ @final
1897
1912
def equals (self , other : Series | DataFrame ) -> _bool : ...
1913
+ @final
1898
1914
def ewm (
1899
1915
self ,
1900
1916
com : float | None = ...,
@@ -1906,6 +1922,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1906
1922
ignore_na : _bool = ...,
1907
1923
axis : Axis = ...,
1908
1924
) -> ExponentialMovingWindow [Self ]: ...
1925
+ @final
1909
1926
def expanding (
1910
1927
self ,
1911
1928
min_periods : int = ...,
@@ -1937,7 +1954,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1937
1954
regex : _str | None = ...,
1938
1955
axis : Axis | None = ...,
1939
1956
) -> Self : ...
1957
+ @final
1940
1958
def first (self , offset ) -> Self : ...
1959
+ @final
1941
1960
def first_valid_index (self ) -> Scalar : ...
1942
1961
def floordiv (
1943
1962
self ,
@@ -1958,7 +1977,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
1958
1977
@overload
1959
1978
def get (self , key : list [Hashable ], default : _T ) -> Self | _T : ...
1960
1979
def gt (self , other , axis : Axis = ..., level : Level | None = ...) -> Self : ...
1980
+ @final
1961
1981
def head (self , n : int = ...) -> Self : ...
1982
+ @final
1962
1983
def infer_objects (self ) -> Self : ...
1963
1984
# def info
1964
1985
@overload
@@ -2000,7 +2021,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2000
2021
numeric_only : _bool = ...,
2001
2022
** kwargs : Any ,
2002
2023
) -> Series : ...
2024
+ @final
2003
2025
def last (self , offset ) -> Self : ...
2026
+ @final
2004
2027
def last_valid_index (self ) -> Scalar : ...
2005
2028
def le (self , other , axis : Axis = ..., level : Level | None = ...) -> Self : ...
2006
2029
def lt (self , other , axis : Axis = ..., level : Level | None = ...) -> Self : ...
@@ -2088,6 +2111,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2088
2111
fill_value : float | None = ...,
2089
2112
) -> Self : ...
2090
2113
def ne (self , other , axis : Axis = ..., level : Level | None = ...) -> Self : ...
2114
+ @final
2091
2115
def pct_change (
2092
2116
self ,
2093
2117
periods : int = ...,
@@ -2130,6 +2154,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2130
2154
level : Level | None = ...,
2131
2155
fill_value : float | None = ...,
2132
2156
) -> Self : ...
2157
+ @final
2133
2158
def rank (
2134
2159
self ,
2135
2160
axis : Axis = ...,
@@ -2146,6 +2171,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2146
2171
level : Level | None = ...,
2147
2172
fill_value : float | None = ...,
2148
2173
) -> Self : ...
2174
+ @final
2149
2175
def reindex_like (
2150
2176
self ,
2151
2177
other : DataFrame ,
@@ -2264,7 +2290,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2264
2290
level : Level | None = ...,
2265
2291
fill_value : float | None = ...,
2266
2292
) -> Self : ...
2267
- # sample is missing a weights arg
2293
+ @ final
2268
2294
def sample (
2269
2295
self ,
2270
2296
n : int | None = ...,
@@ -2294,6 +2320,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2294
2320
numeric_only : _bool = ...,
2295
2321
** kwargs : Any ,
2296
2322
) -> Series : ...
2323
+ @final
2297
2324
def squeeze (self , axis : Axis | None = ...) -> DataFrame | Series | Scalar : ...
2298
2325
def std (
2299
2326
self ,
@@ -2327,7 +2354,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2327
2354
min_count : int = ...,
2328
2355
** kwargs : Any ,
2329
2356
) -> Series : ...
2357
+ @final
2330
2358
def swapaxes (self , axis1 : Axis , axis2 : Axis , copy : _bool = ...) -> Self : ...
2359
+ @final
2331
2360
def tail (self , n : int = ...) -> Self : ...
2332
2361
@overload
2333
2362
def to_json (
@@ -2441,6 +2470,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2441
2470
max_colwidth : int | None = ...,
2442
2471
encoding : _str | None = ...,
2443
2472
) -> _str : ...
2473
+ @final
2444
2474
def to_xarray (self ) -> xr .Dataset : ...
2445
2475
def truediv (
2446
2476
self ,
@@ -2449,20 +2479,23 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2449
2479
level : Level | None = ...,
2450
2480
fill_value : float | None = ...,
2451
2481
) -> Self : ...
2482
+ @final
2452
2483
def truncate (
2453
2484
self ,
2454
2485
before : dt .date | _str | int | None = ...,
2455
2486
after : dt .date | _str | int | None = ...,
2456
2487
axis : Axis | None = ...,
2457
2488
copy : _bool = ...,
2458
2489
) -> Self : ...
2490
+ @final
2459
2491
def tz_convert (
2460
2492
self ,
2461
2493
tz : TimeZones ,
2462
2494
axis : Axis = ...,
2463
2495
level : Level | None = ...,
2464
2496
copy : _bool = ...,
2465
2497
) -> Self : ...
2498
+ @final
2466
2499
def tz_localize (
2467
2500
self ,
2468
2501
tz : TimeZones ,
@@ -2514,7 +2547,9 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2514
2547
level : Level | None = ...,
2515
2548
) -> Self : ...
2516
2549
# Move from generic because Series is Generic and it returns Series[bool] there
2550
+ @final
2517
2551
def __invert__ (self ) -> Self : ...
2552
+ @final
2518
2553
def xs (
2519
2554
self ,
2520
2555
key : Hashable ,
@@ -2531,6 +2566,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
2531
2566
) -> Self : ...
2532
2567
def __truediv__ (self , other : float | DataFrame | Series | Sequence ) -> Self : ...
2533
2568
def __rtruediv__ (self , other : float | DataFrame | Series | Sequence ) -> Self : ...
2569
+ @final
2534
2570
def __bool__ (self ) -> NoReturn : ...
2535
2571
2536
2572
class _PandasNamedTuple (tuple [Any , ...]):
0 commit comments