File tree 1 file changed +26
-0
lines changed
pandas/tests/series/methods
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 20
20
date_range ,
21
21
isna ,
22
22
)
23
+ from pandas .core .arrays import period_array
24
+
23
25
import pandas ._testing as tm
24
26
25
27
@@ -946,3 +948,27 @@ def test_datetime64tz_fillna_round_issue(self):
946
948
)
947
949
948
950
tm .assert_series_equal (filled , expected )
951
+
952
+ def test_fillna_parr (self ):
953
+ # GH-24537
954
+ dti = date_range (
955
+ Timestamp .max - Timedelta (nanoseconds = 10 ), periods = 5 , freq = "ns"
956
+ )
957
+ pi = dti .to_period ("ns" )
958
+ parr = pi ._data
959
+ parr [2 ] = NaT
960
+ arr = period_array (
961
+ [
962
+ Timestamp ("2262-04-11 23:47:16.854775797" ),
963
+ Timestamp ("2262-04-11 23:47:16.854775798" ),
964
+ Timestamp ("2262-04-11 23:47:16.854775798" ),
965
+ Timestamp ("2262-04-11 23:47:16.854775800" ),
966
+ Timestamp ("2262-04-11 23:47:16.854775801" ),
967
+ ],
968
+ freq = "ns" ,
969
+ )
970
+ expected = Series (arr )
971
+
972
+ filled = Series (parr .fillna (method = "pad" ))
973
+
974
+ tm .assert_series_equal (filled , expected )
You can’t perform that action at this time.
0 commit comments