diff --git a/asv_bench/benchmarks/stat_ops.py b/asv_bench/benchmarks/stat_ops.py index ed5ebfa61594e..ec67394e55a1e 100644 --- a/asv_bench/benchmarks/stat_ops.py +++ b/asv_bench/benchmarks/stat_ops.py @@ -7,20 +7,14 @@ class FrameOps: - params = [ops, ["float", "int"], [0, 1], [True, False]] - param_names = ["op", "dtype", "axis", "use_bottleneck"] + params = [ops, ["float", "int"], [0, 1]] + param_names = ["op", "dtype", "axis"] - def setup(self, op, dtype, axis, use_bottleneck): + def setup(self, op, dtype, axis): df = pd.DataFrame(np.random.randn(100000, 4)).astype(dtype) - try: - pd.options.compute.use_bottleneck = use_bottleneck - except TypeError: - from pandas.core import nanops - - nanops._USE_BOTTLENECK = use_bottleneck self.df_func = getattr(df, op) - def time_op(self, op, dtype, axis, use_bottleneck): + def time_op(self, op, dtype, axis): self.df_func(axis=axis) @@ -46,20 +40,14 @@ def time_op(self, level, op): class SeriesOps: - params = [ops, ["float", "int"], [True, False]] - param_names = ["op", "dtype", "use_bottleneck"] + params = [ops, ["float", "int"]] + param_names = ["op", "dtype"] - def setup(self, op, dtype, use_bottleneck): + def setup(self, op, dtype): s = pd.Series(np.random.randn(100000)).astype(dtype) - try: - pd.options.compute.use_bottleneck = use_bottleneck - except TypeError: - from pandas.core import nanops - - nanops._USE_BOTTLENECK = use_bottleneck self.s_func = getattr(s, op) - def time_op(self, op, dtype, use_bottleneck): + def time_op(self, op, dtype): self.s_func() @@ -101,61 +89,49 @@ def time_average_old(self, constructor, pct): class Correlation: - params = [["spearman", "kendall", "pearson"], [True, False]] - param_names = ["method", "use_bottleneck"] + params = [["spearman", "kendall", "pearson"]] + param_names = ["method"] - def setup(self, method, use_bottleneck): - try: - pd.options.compute.use_bottleneck = use_bottleneck - except TypeError: - from pandas.core import nanops + def setup(self, method): + self.df = pd.DataFrame(np.random.randn(500, 15)) + self.df2 = pd.DataFrame(np.random.randn(500, 15)) + self.df_wide = pd.DataFrame(np.random.randn(500, 100)) + self.df_wide_nans = self.df_wide.where(np.random.random((500, 100)) < 0.9) + self.s = pd.Series(np.random.randn(500)) + self.s2 = pd.Series(np.random.randn(500)) - nanops._USE_BOTTLENECK = use_bottleneck - self.df = pd.DataFrame(np.random.randn(1000, 30)) - self.df2 = pd.DataFrame(np.random.randn(1000, 30)) - self.df_wide = pd.DataFrame(np.random.randn(1000, 200)) - self.df_wide_nans = self.df_wide.where(np.random.random((1000, 200)) < 0.9) - self.s = pd.Series(np.random.randn(1000)) - self.s2 = pd.Series(np.random.randn(1000)) - - def time_corr(self, method, use_bottleneck): + def time_corr(self, method): self.df.corr(method=method) - def time_corr_wide(self, method, use_bottleneck): + def time_corr_wide(self, method): self.df_wide.corr(method=method) - def time_corr_wide_nans(self, method, use_bottleneck): + def time_corr_wide_nans(self, method): self.df_wide_nans.corr(method=method) - def peakmem_corr_wide(self, method, use_bottleneck): + def peakmem_corr_wide(self, method): self.df_wide.corr(method=method) - def time_corr_series(self, method, use_bottleneck): + def time_corr_series(self, method): self.s.corr(self.s2, method=method) - def time_corrwith_cols(self, method, use_bottleneck): + def time_corrwith_cols(self, method): self.df.corrwith(self.df2, method=method) - def time_corrwith_rows(self, method, use_bottleneck): + def time_corrwith_rows(self, method): self.df.corrwith(self.df2, axis=1, method=method) class Covariance: - params = [[True, False]] - param_names = ["use_bottleneck"] - - def setup(self, use_bottleneck): - try: - pd.options.compute.use_bottleneck = use_bottleneck - except TypeError: - from pandas.core import nanops + params = [] + param_names = [] - nanops._USE_BOTTLENECK = use_bottleneck + def setup(self): self.s = pd.Series(np.random.randn(100000)) self.s2 = pd.Series(np.random.randn(100000)) - def time_cov_series(self, use_bottleneck): + def time_cov_series(self): self.s.cov(self.s2)