Skip to content

Commit 2a2d0af

Browse files
committed
flake8 fixups
1 parent 0e9be35 commit 2a2d0af

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Diff for: pandas/tests/frame/test_analytics.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ def test_stat_op_api(self, float_frame, float_string_frame):
718718
assert_stat_op_api('median', float_frame, float_string_frame)
719719

720720
try:
721-
from scipy.stats import skew, kurtosis
721+
from scipy.stats import skew, kurtosis # noqa:F401
722722
assert_stat_op_api('skew', float_frame, float_string_frame)
723723
assert_stat_op_api('kurt', float_frame, float_string_frame)
724724
except ImportError:
@@ -739,19 +739,19 @@ def var(x):
739739
return np.var(x, ddof=1)
740740

741741
def std(x):
742-
return x: np.std(x, ddof=1)
742+
return np.std(x, ddof=1)
743743

744744
def sem(x):
745745
return np.std(x, ddof=1) / np.sqrt(len(x))
746746

747-
def skew(x):
748-
from scipy.stats import skew
747+
def skewness(x):
748+
from scipy.stats import skew # noqa:F811
749749
if len(x) < 3:
750750
return np.nan
751751
return skew(x, bias=False)
752752

753753
def kurt(x):
754-
from scipy.stats import kurtosis
754+
from scipy.stats import kurtosis # noqa:F811
755755
if len(x) < 4:
756756
return np.nan
757757
return kurtosis(x, bias=False)
@@ -770,20 +770,18 @@ def kurt(x):
770770
check_dates=True)
771771
assert_stat_op_calc('product', np.prod, float_frame_with_na)
772772

773-
774773
assert_stat_op_calc('mad', mad, float_frame_with_na)
775774
assert_stat_op_calc('var', var, float_frame_with_na)
776775
assert_stat_op_calc('std', std, float_frame_with_na)
777776
assert_stat_op_calc('sem', sem, float_frame_with_na)
778777

779-
780778
assert_stat_op_calc('count', count, float_frame_with_na,
781779
has_skipna=False, check_dtype=False,
782780
check_dates=True)
783781

784782
try:
785-
from scipy import skew, kurtosis
786-
assert_stat_op_calc('skew', skew, float_frame_with_na)
783+
from scipy import skew, kurtosis # noqa:F401
784+
assert_stat_op_calc('skew', skewness, float_frame_with_na)
787785
assert_stat_op_calc('kurt', kurt, float_frame_with_na)
788786
except ImportError:
789787
pass

0 commit comments

Comments
 (0)