Skip to content

Commit ed6f9c9

Browse files
author
MomIsBestFriend
committed
Added skip if no scipy decorator
1 parent a7decf4 commit ed6f9c9

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

pandas/tests/frame/methods/test_cov_corr.py

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_corr_int(self):
155155

156156

157157
class TestDataFrameCorrWith:
158+
@td.skip_if_no_scipy
158159
def test_corrwith(self, datetime_frame):
159160
a = datetime_frame
160161
noise = Series(np.random.randn(len(a)), index=a.index)
@@ -203,6 +204,7 @@ def test_corrwith_with_objects(self):
203204
expected = df1.loc[:, cols].corrwith(df2.loc[:, cols], axis=1)
204205
tm.assert_series_equal(result, expected)
205206

207+
@td.skip_if_no_scipy
206208
def test_corrwith_series(self, datetime_frame):
207209
result = datetime_frame.corrwith(datetime_frame["A"])
208210
expected = datetime_frame.apply(datetime_frame["A"].corr)
@@ -218,6 +220,7 @@ def test_corrwith_matches_corrcoef(self):
218220
tm.assert_almost_equal(c1, c2)
219221
assert c1 < 1
220222

223+
@td.skip_if_no_scipy
221224
def test_corrwith_mixed_dtypes(self):
222225
# GH#18570
223226
df = pd.DataFrame(

pandas/tests/series/test_timeseries.py

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def test_asfreq_datetimeindex_empty_series(self):
7676
result = Series([3], index=index.copy()).asfreq("H")
7777
tm.assert_index_equal(expected.index, result.index)
7878

79+
@td.skip_if_no_scipy
7980
def test_autocorr(self, datetime_series):
8081
# Just run the function
8182
corr1 = datetime_series.autocorr()

pandas/tests/test_nanops.py

+2
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ def check_nancorr_nancov_1d(self, checkfun, targ0, targ1, **kwargs):
560560
tm.assert_almost_equal(targ2, res24)
561561
tm.assert_almost_equal(targ2, res25)
562562

563+
@td.skip_if_no_scipy
563564
def test_nancorr(self):
564565
targ0 = np.corrcoef(self.arr_float_2d, self.arr_float1_2d)[0, 1]
565566
targ1 = np.corrcoef(self.arr_float_2d.flat, self.arr_float1_2d.flat)[0, 1]
@@ -568,6 +569,7 @@ def test_nancorr(self):
568569
targ1 = np.corrcoef(self.arr_float_1d.flat, self.arr_float1_1d.flat)[0, 1]
569570
self.check_nancorr_nancov_1d(nanops.nancorr, targ0, targ1, method="pearson")
570571

572+
@td.skip_if_no_scipy
571573
def test_nancorr_pearson(self):
572574
targ0 = np.corrcoef(self.arr_float_2d, self.arr_float1_2d)[0, 1]
573575
targ1 = np.corrcoef(self.arr_float_2d.flat, self.arr_float1_2d.flat)[0, 1]

pandas/tests/window/moments/test_moments_rolling.py

+1
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ def test_rolling_cov(self):
10971097
def test_rolling_cov_pairwise(self):
10981098
self._check_pairwise_moment("rolling", "cov", window=10, min_periods=5)
10991099

1100+
@td.skip_if_no_scipy
11001101
def test_rolling_corr(self):
11011102
A = self.series
11021103
B = A + randn(len(A))

0 commit comments

Comments
 (0)