Skip to content

removing kendall tests #29401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 28 additions & 52 deletions asv_bench/benchmarks/stat_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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()


Expand Down Expand Up @@ -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)


Expand Down