20
20
TYPE_CHECKING ,
21
21
Any ,
22
22
Literal ,
23
+ Self ,
23
24
cast ,
24
25
overload ,
25
26
)
40
41
from pandas .errors import (
41
42
ChainedAssignmentError ,
42
43
InvalidIndexError ,
44
+ Pandas4Warning ,
43
45
)
44
46
from pandas .errors .cow import (
45
47
_chained_assignment_method_msg ,
191
193
ReindexMethod ,
192
194
Renamer ,
193
195
Scalar ,
194
- Self ,
195
196
SortKind ,
196
197
StorageOptions ,
197
198
Suffixes ,
@@ -764,11 +765,13 @@ def values(self):
764
765
array([1, 2, 3])
765
766
766
767
>>> pd.Series(list("aabc")).values
767
- array(['a', 'a', 'b', 'c'], dtype=object)
768
+ <ArrowStringArrayNumpySemantics>
769
+ ['a', 'a', 'b', 'c']
770
+ Length: 4, dtype: str
768
771
769
772
>>> pd.Series(list("aabc")).astype("category").values
770
773
['a', 'a', 'b', 'c']
771
- Categories (3, object ): ['a', 'b', 'c']
774
+ Categories (3, str ): ['a', 'b', 'c']
772
775
773
776
Timezone aware datetime data is converted to UTC:
774
777
@@ -1471,7 +1474,7 @@ def to_string(
1471
1474
) -> None : ...
1472
1475
1473
1476
@deprecate_nonkeyword_arguments (
1474
- version = "4.0" , allowed_args = ["self" , "buf" ], name = "to_string"
1477
+ Pandas4Warning , allowed_args = ["self" , "buf" ], name = "to_string"
1475
1478
)
1476
1479
def to_string (
1477
1480
self ,
@@ -1629,7 +1632,7 @@ def to_markdown(
1629
1632
),
1630
1633
)
1631
1634
@deprecate_nonkeyword_arguments (
1632
- version = "4.0" , allowed_args = ["self" , "buf" ], name = "to_markdown"
1635
+ Pandas4Warning , allowed_args = ["self" , "buf" ], name = "to_markdown"
1633
1636
)
1634
1637
def to_markdown (
1635
1638
self ,
@@ -1970,7 +1973,7 @@ def groupby(
1970
1973
as_index : bool = True ,
1971
1974
sort : bool = True ,
1972
1975
group_keys : bool = True ,
1973
- observed : bool = False ,
1976
+ observed : bool = True ,
1974
1977
dropna : bool = True ,
1975
1978
) -> SeriesGroupBy :
1976
1979
from pandas .core .groupby .generic import SeriesGroupBy
@@ -2144,12 +2147,12 @@ def unique(self) -> ArrayLike:
2144
2147
2145
2148
>>> pd.Series(pd.Categorical(list("baabc"))).unique()
2146
2149
['b', 'a', 'c']
2147
- Categories (3, object ): ['a', 'b', 'c']
2150
+ Categories (3, str ): ['a', 'b', 'c']
2148
2151
>>> pd.Series(
2149
2152
... pd.Categorical(list("baabc"), categories=list("abc"), ordered=True)
2150
2153
... ).unique()
2151
2154
['b', 'a', 'c']
2152
- Categories (3, object ): ['a' < 'b' < 'c']
2155
+ Categories (3, str ): ['a' < 'b' < 'c']
2153
2156
"""
2154
2157
return super ().unique ()
2155
2158
@@ -3109,7 +3112,8 @@ def combine(
3109
3112
Function that takes two scalars as inputs and returns an element.
3110
3113
fill_value : scalar, optional
3111
3114
The value to assume when an index is missing from
3112
- one Series or the other. The default specifies to use the
3115
+ one Series or the other. Scalars are any value that is not a numpy.ndarray,
3116
+ list, tuple or Series. The default specifies to use the
3113
3117
appropriate NaN value for the underlying dtype of the Series.
3114
3118
3115
3119
Returns
@@ -6070,6 +6074,11 @@ def eq(
6070
6074
Equivalent to ``series == other``, but with support to substitute a fill_value
6071
6075
for missing data in either one of the inputs.
6072
6076
6077
+ By default, comparisons with missing values (e.g. ``np.nan``, ``pd.NA``) will
6078
+ return ``False`` for those positions, even when comparing missing values to
6079
+ themselves. If ``fill_value`` is specified, missing values are replaced before
6080
+ comparison.
6081
+
6073
6082
Parameters
6074
6083
----------
6075
6084
other : Series or scalar value
@@ -6683,7 +6692,7 @@ def any( # type: ignore[override]
6683
6692
filter_type = "bool" ,
6684
6693
)
6685
6694
6686
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "all" )
6695
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "all" )
6687
6696
@Appender (make_doc ("all" , ndim = 1 ))
6688
6697
def all (
6689
6698
self ,
@@ -6703,7 +6712,7 @@ def all(
6703
6712
filter_type = "bool" ,
6704
6713
)
6705
6714
6706
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "min" )
6715
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "min" )
6707
6716
def min (
6708
6717
self ,
6709
6718
axis : Axis | None = 0 ,
@@ -6774,7 +6783,7 @@ def min(
6774
6783
self , axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
6775
6784
)
6776
6785
6777
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "max" )
6786
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "max" )
6778
6787
def max (
6779
6788
self ,
6780
6789
axis : Axis | None = 0 ,
@@ -6845,7 +6854,7 @@ def max(
6845
6854
self , axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
6846
6855
)
6847
6856
6848
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "sum" )
6857
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "sum" )
6849
6858
def sum (
6850
6859
self ,
6851
6860
axis : Axis | None = None ,
@@ -6946,7 +6955,7 @@ def sum(
6946
6955
** kwargs ,
6947
6956
)
6948
6957
6949
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "prod" )
6958
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "prod" )
6950
6959
@doc (make_doc ("prod" , ndim = 1 ))
6951
6960
def prod (
6952
6961
self ,
@@ -6965,7 +6974,7 @@ def prod(
6965
6974
** kwargs ,
6966
6975
)
6967
6976
6968
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "mean" )
6977
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "mean" )
6969
6978
def mean (
6970
6979
self ,
6971
6980
axis : Axis | None = 0 ,
@@ -7019,7 +7028,9 @@ def mean(
7019
7028
self , axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
7020
7029
)
7021
7030
7022
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "median" )
7031
+ @deprecate_nonkeyword_arguments (
7032
+ Pandas4Warning , allowed_args = ["self" ], name = "median"
7033
+ )
7023
7034
def median (
7024
7035
self ,
7025
7036
axis : Axis | None = 0 ,
@@ -7100,7 +7111,7 @@ def median(
7100
7111
self , axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
7101
7112
)
7102
7113
7103
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "sem" )
7114
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "sem" )
7104
7115
@doc (make_doc ("sem" , ndim = 1 ))
7105
7116
def sem (
7106
7117
self ,
@@ -7119,7 +7130,7 @@ def sem(
7119
7130
** kwargs ,
7120
7131
)
7121
7132
7122
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "var" )
7133
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "var" )
7123
7134
def var (
7124
7135
self ,
7125
7136
axis : Axis | None = None ,
@@ -7206,7 +7217,7 @@ def var(
7206
7217
** kwargs ,
7207
7218
)
7208
7219
7209
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "std" )
7220
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "std" )
7210
7221
@doc (make_doc ("std" , ndim = 1 ))
7211
7222
def std (
7212
7223
self ,
@@ -7225,7 +7236,7 @@ def std(
7225
7236
** kwargs ,
7226
7237
)
7227
7238
7228
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "skew" )
7239
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "skew" )
7229
7240
@doc (make_doc ("skew" , ndim = 1 ))
7230
7241
def skew (
7231
7242
self ,
@@ -7238,7 +7249,7 @@ def skew(
7238
7249
self , axis = axis , skipna = skipna , numeric_only = numeric_only , ** kwargs
7239
7250
)
7240
7251
7241
- @deprecate_nonkeyword_arguments (version = "4.0" , allowed_args = ["self" ], name = "kurt" )
7252
+ @deprecate_nonkeyword_arguments (Pandas4Warning , allowed_args = ["self" ], name = "kurt" )
7242
7253
def kurt (
7243
7254
self ,
7244
7255
axis : Axis | None = 0 ,
0 commit comments