@@ -865,12 +865,17 @@ def test_rolling_functions_window_non_shrinkage(self):
865
865
lambda x : mom .rolling_window (x , win_type = 'boxcar' , window = 10 , min_periods = 5 ),
866
866
]
867
867
for f in functions :
868
- s_result = f (s )
869
- assert_series_equal (s_result , s_expected )
870
-
871
- df_result = f (df )
872
- assert_frame_equal (df_result , df_expected )
873
-
868
+ try :
869
+ s_result = f (s )
870
+ assert_series_equal (s_result , s_expected )
871
+
872
+ df_result = f (df )
873
+ assert_frame_equal (df_result , df_expected )
874
+ except (ImportError ):
875
+
876
+ # scipy needed for rolling_window
877
+ continue
878
+
874
879
functions = [lambda x : mom .rolling_cov (x , x , pairwise = True , window = 10 , min_periods = 5 ),
875
880
lambda x : mom .rolling_corr (x , x , pairwise = True , window = 10 , min_periods = 5 ),
876
881
# rolling_corr_pairwise is depracated, so the following line should be deleted
@@ -896,7 +901,7 @@ def test_expanding_cov_pairwise_diff_length(self):
896
901
assert_frame_equal (result2 , expected )
897
902
assert_frame_equal (result3 , expected )
898
903
assert_frame_equal (result4 , expected )
899
-
904
+
900
905
def test_expanding_corr_pairwise_diff_length (self ):
901
906
# GH 7512
902
907
df1 = DataFrame ([[1 ,2 ], [3 , 2 ], [3 ,4 ]], columns = ['A' ,'B' ])
@@ -912,7 +917,7 @@ def test_expanding_corr_pairwise_diff_length(self):
912
917
assert_frame_equal (result2 , expected )
913
918
assert_frame_equal (result3 , expected )
914
919
assert_frame_equal (result4 , expected )
915
-
920
+
916
921
def test_rolling_skew_edge_cases (self ):
917
922
918
923
all_nan = Series ([np .NaN ] * 5 )
0 commit comments