@@ -16,7 +16,7 @@ from pandas.core.window.rolling import Rolling, Window
16
16
from pandas ._typing import ArrayLike as ArrayLike , AxisType as AxisType , Dtype as Dtype , DtypeNp as DtypeNp , \
17
17
FilePathOrBuffer as FilePathOrBuffer , Level as Level , MaskType as MaskType , S1 as S1 , Scalar as Scalar , \
18
18
SeriesAxisType as SeriesAxisType , num as num , Label
19
- from typing import Any , Callable , Dict , Generic , Hashable , Iterable , List , Optional , Sequence , Tuple , Type , Union , overload
19
+ from typing import Any , Callable , Dict , Generic , Hashable , Iterable , List , Mapping , Optional , Sequence , Tuple , Type , Union , overload
20
20
if sys .version_info >= (3 , 8 ):
21
21
from typing import Literal
22
22
else :
@@ -162,9 +162,9 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
162
162
encoding : Optional [_str ] = ...,
163
163
) -> _str : ...
164
164
@overload
165
- def to_markdown (self , buf : Optional [FilePathOrBuffer ], mode : Optional [_str ] = ..., ** kwargs ) -> None : ...
165
+ def to_markdown (self , buf : Optional [FilePathOrBuffer ], mode : Optional [_str ] = ..., index : _bool = ..., storage_options : Optional [ dict ] = ..., ** kwargs ) -> None : ...
166
166
@overload
167
- def to_markdown (self , mode : Optional [_str ] = ...,) -> _str : ...
167
+ def to_markdown (self , mode : Optional [_str ] = ..., index : _bool = ..., storage_options : Optional [ dict ] = ... ) -> _str : ...
168
168
def items (self ) -> Iterable [Tuple [Union [int , _str ], S1 ]]: ...
169
169
def iteritems (self ) -> Iterable [Tuple [Label , S1 ]]: ...
170
170
def keys (self ) -> List : ...
@@ -180,6 +180,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
180
180
group_keys : _bool = ...,
181
181
squeeze : _bool = ...,
182
182
observed : _bool = ...,
183
+ dropna : _bool = ...
183
184
) -> SeriesGroupBy : ...
184
185
@overload
185
186
def count (self , level : None = ...) -> int : ...
@@ -203,11 +204,13 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
203
204
def corr (
204
205
self , other : Series [S1 ], method : Literal ["pearson" , "kendall" , "spearman" ] = ..., min_periods : int = ...,
205
206
) -> float : ...
206
- def cov (self , other : Series [S1 ], min_periods : Optional [int ] = ...) -> float : ...
207
+ def cov (self , other : Series [S1 ], min_periods : Optional [int ] = ..., ddof : int = ... ) -> float : ...
207
208
def diff (self , periods : int = ...) -> Series [S1 ]: ...
208
209
def autocorr (self , lag : int = ...) -> float : ...
209
210
@overload
210
- def dot (self , other : Union [DataFrame , Series [S1 ]]) -> Series [S1 ]: ...
211
+ def dot (self , other : Series [S1 ]) -> Scalar : ...
212
+ @overload
213
+ def dot (self , other : DataFrame ) -> Series [S1 ]: ...
211
214
@overload
212
215
def dot (self , other : _ListLike ) -> np .ndarray : ...
213
216
def __matmul__ (self , other ): ...
@@ -230,7 +233,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
230
233
self , other : Series [S1 ], func : Callable , fill_value : Optional [Scalar ] = ...
231
234
) -> Series [S1 ]: ...
232
235
def combine_first (self , other : Series [S1 ]) -> Series [S1 ]: ...
233
- def update (self , other : Series [S1 ]) -> None : ...
236
+ def update (self , other : Series [S1 ]| Sequence [ S1 ] | Mapping [ int , S1 ] ) -> None : ...
234
237
def sort_values (
235
238
self ,
236
239
axis : SeriesAxisType = ...,
@@ -297,6 +300,18 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
297
300
fill_axis : SeriesAxisType = ...,
298
301
broadcast_axis : Optional [SeriesAxisType ] = ...,
299
302
) -> Tuple [Series , Series ]: ...
303
+ @overload
304
+ def rename (
305
+ self ,
306
+ index = ...,
307
+ * ,
308
+ inplace : Literal [True ],
309
+ axis : Optional [SeriesAxisType ] = ...,
310
+ copy : _bool = ...,
311
+ level : Optional [Level ] = ...,
312
+ errors : _str | Literal ["raise" , "ignore" ] = ...
313
+ ) -> None : ...
314
+ @overload
300
315
def rename (
301
316
self ,
302
317
index = ...,
@@ -305,30 +320,43 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
305
320
copy : _bool = ...,
306
321
inplace : _bool = ...,
307
322
level : Optional [Level ] = ...,
308
- errors : Union [ _str , Literal ["raise" , "ignore" ] ] = ...
323
+ errors : _str | Literal ["raise" , "ignore" ] = ...
309
324
) -> Series : ...
310
325
def reindex_like (
311
326
self ,
312
327
other : Series [S1 ],
313
- method : Optional [Union [ _str , Literal ["backfill" , "bfill" , "pad" , "ffill" , "nearest" ] ]] = ...,
328
+ method : Optional [_str | Literal ["backfill" , "bfill" , "pad" , "ffill" , "nearest" ]] = ...,
314
329
copy : _bool = ...,
315
330
limit : Optional [int ] = ...,
316
331
tolerance : Optional [float ] = ...,
317
332
) -> Series : ...
333
+ @overload
318
334
def drop (
319
335
self ,
320
- labels : Optional [Union [ _str , List ] ] = ...,
336
+ labels : Optional [_str | int | List ] = ...,
321
337
axis : SeriesAxisType = ...,
322
- index : Optional [Union [List [_str ], List [int ], Index ]] = ...,
323
- columns : Optional [Union [_str , List ]] = ...,
338
+ index : Optional [List [_str ]| List [int ]| Index ] = ...,
339
+ columns : Optional [_str | List ] = ...,
340
+ level : Optional [Level ] = ...,
341
+ errors : Literal ["ignore" , "raise" ] = ...,
342
+ * ,
343
+ inplace : Literal [True ]
344
+ ) -> None : ...
345
+ @overload
346
+ def drop (
347
+ self ,
348
+ labels : Optional [_str | int | List ] = ...,
349
+ axis : SeriesAxisType = ...,
350
+ index : Optional [List [_str ]| List [int ]| Index ] = ...,
351
+ columns : Optional [_str | List ] = ...,
324
352
level : Optional [Level ] = ...,
325
353
inplace : _bool = ...,
326
354
errors : Literal ["ignore" , "raise" ] = ...,
327
355
) -> Series : ...
328
356
@overload
329
357
def fillna (
330
358
self ,
331
- value : Union [Scalar , Dict , Series [S1 ], DataFrame ],
359
+ value : Optional [Scalar | Dict | Series [S1 ]| DataFrame ] = ... ,
332
360
method : Optional [Union [_str , Literal ["backfill" , "bfill" , "pad" , "ffill" ]]] = ...,
333
361
axis : SeriesAxisType = ...,
334
362
limit : Optional [int ] = ...,
@@ -339,7 +367,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
339
367
@overload
340
368
def fillna (
341
369
self ,
342
- value : Union [Scalar , Dict , Series [S1 ], DataFrame ],
370
+ value : Optional [Scalar | Dict | Series [S1 ]| DataFrame ] = ... ,
343
371
method : Optional [Union [_str , Literal ["backfill" , "bfill" , "pad" , "ffill" ]]] = ...,
344
372
axis : SeriesAxisType = ...,
345
373
* ,
@@ -349,7 +377,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
349
377
@overload
350
378
def fillna (
351
379
self ,
352
- value : Union [Scalar , Dict , Series [S1 ], DataFrame ],
380
+ value : Optional [Scalar | Dict | Series [S1 ]| DataFrame ] = ... ,
353
381
method : Optional [Union [_str , Literal ["backfill" , "bfill" , "pad" , "ffill" ]]] = ...,
354
382
axis : SeriesAxisType = ...,
355
383
inplace : _bool = ...,
@@ -381,6 +409,11 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
381
409
def isnull (self ) -> Series [_bool ]: ...
382
410
def notna (self ) -> Series [_bool ]: ...
383
411
def notnull (self ) -> Series [_bool ]: ...
412
+ @overload
413
+ def dropna (
414
+ self , axis : SeriesAxisType = ..., how : Optional [_str ] = ..., * , inplace : Literal [True ]
415
+ ) -> None : ...
416
+ @overload
384
417
def dropna (
385
418
self , axis : SeriesAxisType = ..., inplace : _bool = ..., how : Optional [_str ] = ...,
386
419
) -> Series [S1 ]: ...
@@ -453,33 +486,27 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
453
486
@overload
454
487
def ffill (
455
488
self ,
456
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
457
- axis : SeriesAxisType ,
458
- inplace : Literal [True ],
489
+ value : Union [S1 , Dict , Series [S1 ], DataFrame ] = ...,
490
+ axis : SeriesAxisType = ...,
459
491
limit : Optional [int ] = ...,
460
492
downcast : Optional [Dict ] = ...,
461
- ) -> Series [S1 ]: ...
462
- @overload
463
- def ffill (
464
- self ,
465
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
493
+ * ,
466
494
inplace : Literal [True ],
467
- limit : Optional [int ] = ...,
468
- downcast : Optional [Dict ] = ...,
469
495
) -> None : ...
470
496
@overload
471
497
def ffill (
472
498
self ,
473
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
499
+ value : Union [S1 , Dict , Series [S1 ], DataFrame ] = ... ,
474
500
axis : SeriesAxisType = ...,
475
- * ,
476
501
limit : Optional [int ] = ...,
477
502
downcast : Optional [Dict ] = ...,
478
- ) -> Series [S1 ]: ...
503
+ * ,
504
+ inplace : Literal [False ],
505
+ ) -> Series [S1 ]: ...
479
506
@overload
480
507
def ffill (
481
508
self ,
482
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
509
+ value : Union [S1 , Dict , Series [S1 ], DataFrame ] = ... ,
483
510
axis : SeriesAxisType = ...,
484
511
inplace : _bool = ...,
485
512
limit : Optional [int ] = ...,
@@ -488,7 +515,7 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
488
515
@overload
489
516
def bfill (
490
517
self ,
491
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
518
+ value : Union [S1 , Dict , Series [S1 ], DataFrame ] = ... ,
492
519
axis : SeriesAxisType = ...,
493
520
limit : Optional [int ] = ...,
494
521
downcast : Optional [Dict ] = ...,
@@ -498,12 +525,13 @@ class Series(IndexOpsMixin, NDFrame, Generic[S1]):
498
525
@overload
499
526
def bfill (
500
527
self ,
501
- value : Union [S1 , Dict , Series [S1 ], DataFrame ],
528
+ value : Union [S1 , Dict , Series [S1 ], DataFrame ] = ... ,
502
529
axis : SeriesAxisType = ...,
503
- * ,
504
530
limit : Optional [int ] = ...,
505
531
downcast : Optional [Dict ] = ...,
506
- ) -> Series [S1 ]: ...
532
+ * ,
533
+ inplace : Literal [False ]
534
+ ) -> Series [S1 ]: ...
507
535
@overload
508
536
def bfill (
509
537
self ,
0 commit comments