@@ -977,3 +977,33 @@ def test_args_kwargs_depr(method, raises):
977
977
with tm .assert_produces_warning (FutureWarning , match = warn_msg ):
978
978
with pytest .raises (TypeError , match = error_msg_type ):
979
979
func (* args , 1 , 2 , 3 )
980
+
981
+
982
+ def test_df_axis_param_depr ():
983
+ np .random .seed (1234 )
984
+ index = date_range (datetime (2005 , 1 , 1 ), datetime (2005 , 1 , 10 ), freq = "D" )
985
+ index .name = "date"
986
+ df = DataFrame (np .random .rand (10 , 2 ), columns = list ("AB" ), index = index ).T
987
+
988
+ # Deprication error when axis=1 is explicitly passed
989
+ warning_msg = "DataFrame.resample with axis=1 is deprecated."
990
+ with tm .assert_produces_warning (FutureWarning , match = warning_msg ):
991
+ df .resample ("M" , axis = 1 )
992
+
993
+ # Deprication error when axis=0 is explicitly passed
994
+ df = df .T
995
+ warning_msg = (
996
+ "The 'axis' keyword in DataFrame.resample is deprecated and "
997
+ "will be removed in a future version."
998
+ )
999
+ with tm .assert_produces_warning (FutureWarning , match = warning_msg ):
1000
+ df .resample ("M" , axis = 0 )
1001
+
1002
+
1003
+ def test_series_axis_param_depr ():
1004
+ warning_msg = (
1005
+ "Series resample axis keyword is deprecated and will be removed in a "
1006
+ "future version."
1007
+ )
1008
+ with tm .assert_produces_warning (FutureWarning , match = warning_msg ):
1009
+ test_series .resample ("H" , axis = 0 )
0 commit comments