title stringclasses 1 value | text stringlengths 30 426k | id stringlengths 27 30 |
|---|---|---|
asv_bench/benchmarks/frame_methods.py/Reindex/time_reindex_both_axes
class Reindex:
def time_reindex_both_axes(self):
self.df.reindex(index=self.idx, columns=self.idx_cols) | negative_train_query0_00998 | |
asv_bench/benchmarks/frame_methods.py/Reindex/time_reindex_upcast
class Reindex:
def time_reindex_upcast(self):
self.df2.reindex(np.random.permutation(range(1200))) | negative_train_query0_00999 | |
asv_bench/benchmarks/frame_methods.py/Rename/setup
class Rename:
def setup(self):
N = 10**3
self.df = DataFrame(np.random.randn(N * 10, N))
self.idx = np.arange(4 * N, 7 * N)
self.dict_idx = {k: k for k in self.idx}
self.df2 = DataFrame(
{
c: {
0: np.random.randint(0, 2, N).astype(np.bool_),
1: np.random.randint(0, N, N).astype(np.int16),
2: np.random.randint(0, N, N).astype(np.int32),
3: np.random.randint(0, N, N).astype(np.int64),
}[np.random.randint(0, 4)]
for c in range(N)
}
) | negative_train_query0_01000 | |
asv_bench/benchmarks/frame_methods.py/Rename/time_rename_single
class Rename:
def time_rename_single(self):
self.df.rename({0: 0}) | negative_train_query0_01001 | |
asv_bench/benchmarks/frame_methods.py/Rename/time_rename_axis0
class Rename:
def time_rename_axis0(self):
self.df.rename(self.dict_idx) | negative_train_query0_01002 | |
asv_bench/benchmarks/frame_methods.py/Rename/time_rename_axis1
class Rename:
def time_rename_axis1(self):
self.df.rename(columns=self.dict_idx) | negative_train_query0_01003 | |
asv_bench/benchmarks/frame_methods.py/Rename/time_rename_both_axes
class Rename:
def time_rename_both_axes(self):
self.df.rename(index=self.dict_idx, columns=self.dict_idx) | negative_train_query0_01004 | |
asv_bench/benchmarks/frame_methods.py/Rename/time_dict_rename_both_axes
class Rename:
def time_dict_rename_both_axes(self):
self.df.rename(index=self.dict_idx, columns=self.dict_idx) | negative_train_query0_01005 | |
asv_bench/benchmarks/frame_methods.py/Iteration/setup
class Iteration:
def setup(self):
N = 1000
self.df = DataFrame(np.random.randn(N * 10, N))
self.df2 = DataFrame(np.random.randn(N * 50, 10))
self.df3 = DataFrame(
np.random.randn(N, 5 * N), columns=["C" + str(c) for c in range(N * 5)]
)
self.df4 = DataFrame(np.random.randn(N * 1000, 10)) | negative_train_query0_01006 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_items
class Iteration:
def time_items(self):
# (monitor no-copying behaviour)
for name, col in self.df.items():
pass | negative_train_query0_01007 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_iteritems_indexing
class Iteration:
def time_iteritems_indexing(self):
for col in self.df3:
self.df3[col] | negative_train_query0_01008 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_start
class Iteration:
def time_itertuples_start(self):
self.df4.itertuples() | negative_train_query0_01009 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_read_first
class Iteration:
def time_itertuples_read_first(self):
next(self.df4.itertuples()) | negative_train_query0_01010 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples
class Iteration:
def time_itertuples(self):
for row in self.df4.itertuples():
pass | negative_train_query0_01011 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_to_list
class Iteration:
def time_itertuples_to_list(self):
list(self.df4.itertuples()) | negative_train_query0_01012 | |
asv_bench/benchmarks/frame_methods.py/Iteration/mem_itertuples_start
class Iteration:
def mem_itertuples_start(self):
return self.df4.itertuples() | negative_train_query0_01013 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_start
class Iteration:
def peakmem_itertuples_start(self):
self.df4.itertuples() | negative_train_query0_01014 | |
asv_bench/benchmarks/frame_methods.py/Iteration/mem_itertuples_read_first
class Iteration:
def mem_itertuples_read_first(self):
return next(self.df4.itertuples()) | negative_train_query0_01015 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples
class Iteration:
def peakmem_itertuples(self):
for row in self.df4.itertuples():
pass | negative_train_query0_01016 | |
asv_bench/benchmarks/frame_methods.py/Iteration/mem_itertuples_to_list
class Iteration:
def mem_itertuples_to_list(self):
return list(self.df4.itertuples()) | negative_train_query0_01017 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_to_list
class Iteration:
def peakmem_itertuples_to_list(self):
list(self.df4.itertuples()) | negative_train_query0_01018 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_raw_start
class Iteration:
def time_itertuples_raw_start(self):
self.df4.itertuples(index=False, name=None) | negative_train_query0_01019 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_raw_read_first
class Iteration:
def time_itertuples_raw_read_first(self):
next(self.df4.itertuples(index=False, name=None)) | negative_train_query0_01020 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_raw_tuples
class Iteration:
def time_itertuples_raw_tuples(self):
for row in self.df4.itertuples(index=False, name=None):
pass | negative_train_query0_01021 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_itertuples_raw_tuples_to_list
class Iteration:
def time_itertuples_raw_tuples_to_list(self):
list(self.df4.itertuples(index=False, name=None)) | negative_train_query0_01022 | |
asv_bench/benchmarks/frame_methods.py/Iteration/mem_itertuples_raw_start
class Iteration:
def mem_itertuples_raw_start(self):
return self.df4.itertuples(index=False, name=None) | negative_train_query0_01023 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_raw_start
class Iteration:
def peakmem_itertuples_raw_start(self):
self.df4.itertuples(index=False, name=None) | negative_train_query0_01024 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_raw_read_first
class Iteration:
def peakmem_itertuples_raw_read_first(self):
next(self.df4.itertuples(index=False, name=None)) | negative_train_query0_01025 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_raw
class Iteration:
def peakmem_itertuples_raw(self):
for row in self.df4.itertuples(index=False, name=None):
pass | negative_train_query0_01026 | |
asv_bench/benchmarks/frame_methods.py/Iteration/mem_itertuples_raw_to_list
class Iteration:
def mem_itertuples_raw_to_list(self):
return list(self.df4.itertuples(index=False, name=None)) | negative_train_query0_01027 | |
asv_bench/benchmarks/frame_methods.py/Iteration/peakmem_itertuples_raw_to_list
class Iteration:
def peakmem_itertuples_raw_to_list(self):
list(self.df4.itertuples(index=False, name=None)) | negative_train_query0_01028 | |
asv_bench/benchmarks/frame_methods.py/Iteration/time_iterrows
class Iteration:
def time_iterrows(self):
for row in self.df.iterrows():
pass | negative_train_query0_01029 | |
asv_bench/benchmarks/frame_methods.py/ToString/setup
class ToString:
def setup(self):
self.df = DataFrame(np.random.randn(100, 10)) | negative_train_query0_01030 | |
asv_bench/benchmarks/frame_methods.py/ToString/time_to_string_floats
class ToString:
def time_to_string_floats(self):
self.df.to_string() | negative_train_query0_01031 | |
asv_bench/benchmarks/frame_methods.py/ToHTML/setup
class ToHTML:
def setup(self):
nrows = 500
self.df2 = DataFrame(np.random.randn(nrows, 10))
self.df2[0] = period_range("2000", periods=nrows)
self.df2[1] = range(nrows) | negative_train_query0_01032 | |
asv_bench/benchmarks/frame_methods.py/ToHTML/time_to_html_mixed
class ToHTML:
def time_to_html_mixed(self):
self.df2.to_html() | negative_train_query0_01033 | |
asv_bench/benchmarks/frame_methods.py/ToDict/setup
class ToDict:
def setup(self, orient):
data = np.random.randint(0, 1000, size=(10000, 4))
self.int_df = DataFrame(data)
self.datetimelike_df = self.int_df.astype("timedelta64[ns]") | negative_train_query0_01034 | |
asv_bench/benchmarks/frame_methods.py/ToDict/time_to_dict_ints
class ToDict:
def time_to_dict_ints(self, orient):
self.int_df.to_dict(orient=orient) | negative_train_query0_01035 | |
asv_bench/benchmarks/frame_methods.py/ToDict/time_to_dict_datetimelike
class ToDict:
def time_to_dict_datetimelike(self, orient):
self.datetimelike_df.to_dict(orient=orient) | negative_train_query0_01036 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/setup
class ToNumpy:
def setup(self):
N = 10000
M = 10
self.df_tall = DataFrame(np.random.randn(N, M))
self.df_wide = DataFrame(np.random.randn(M, N))
self.df_mixed_tall = self.df_tall.copy()
self.df_mixed_tall["foo"] = "bar"
self.df_mixed_tall[0] = period_range("2000", periods=N)
self.df_mixed_tall[1] = range(N)
self.df_mixed_wide = self.df_wide.copy()
self.df_mixed_wide["foo"] = "bar"
self.df_mixed_wide[0] = period_range("2000", periods=M)
self.df_mixed_wide[1] = range(M) | negative_train_query0_01037 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_to_numpy_tall
class ToNumpy:
def time_to_numpy_tall(self):
self.df_tall.to_numpy() | negative_train_query0_01038 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_to_numpy_wide
class ToNumpy:
def time_to_numpy_wide(self):
self.df_wide.to_numpy() | negative_train_query0_01039 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_to_numpy_mixed_tall
class ToNumpy:
def time_to_numpy_mixed_tall(self):
self.df_mixed_tall.to_numpy() | negative_train_query0_01040 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_to_numpy_mixed_wide
class ToNumpy:
def time_to_numpy_mixed_wide(self):
self.df_mixed_wide.to_numpy() | negative_train_query0_01041 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_values_tall
class ToNumpy:
def time_values_tall(self):
self.df_tall.values | negative_train_query0_01042 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_values_wide
class ToNumpy:
def time_values_wide(self):
self.df_wide.values | negative_train_query0_01043 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_values_mixed_tall
class ToNumpy:
def time_values_mixed_tall(self):
self.df_mixed_tall.values | negative_train_query0_01044 | |
asv_bench/benchmarks/frame_methods.py/ToNumpy/time_values_mixed_wide
class ToNumpy:
def time_values_mixed_wide(self):
self.df_mixed_wide.values | negative_train_query0_01045 | |
asv_bench/benchmarks/frame_methods.py/ToRecords/setup
class ToRecords:
def setup(self):
N = 100_000
data = np.random.randn(N, 2)
mi = MultiIndex.from_arrays(
[
np.arange(N),
date_range("1970-01-01", periods=N, freq="ms"),
]
)
self.df = DataFrame(data)
self.df_mi = DataFrame(data, index=mi) | negative_train_query0_01046 | |
asv_bench/benchmarks/frame_methods.py/ToRecords/time_to_records
class ToRecords:
def time_to_records(self):
self.df.to_records(index=True) | negative_train_query0_01047 | |
asv_bench/benchmarks/frame_methods.py/ToRecords/time_to_records_multiindex
class ToRecords:
def time_to_records_multiindex(self):
self.df_mi.to_records(index=True) | negative_train_query0_01048 | |
asv_bench/benchmarks/frame_methods.py/Repr/setup
class Repr:
def setup(self):
nrows = 10000
data = np.random.randn(nrows, 10)
arrays = np.tile(np.random.randn(3, nrows // 100), 100)
idx = MultiIndex.from_arrays(arrays)
self.df3 = DataFrame(data, index=idx)
self.df4 = DataFrame(data, index=np.random.randn(nrows))
self.df_tall = DataFrame(np.random.randn(nrows, 10))
self.df_wide = DataFrame(np.random.randn(10, nrows)) | negative_train_query0_01049 | |
asv_bench/benchmarks/frame_methods.py/Repr/time_html_repr_trunc_mi
class Repr:
def time_html_repr_trunc_mi(self):
self.df3._repr_html_() | negative_train_query0_01050 | |
asv_bench/benchmarks/frame_methods.py/Repr/time_html_repr_trunc_si
class Repr:
def time_html_repr_trunc_si(self):
self.df4._repr_html_() | negative_train_query0_01051 | |
asv_bench/benchmarks/frame_methods.py/Repr/time_repr_tall
class Repr:
def time_repr_tall(self):
repr(self.df_tall) | negative_train_query0_01052 | |
asv_bench/benchmarks/frame_methods.py/Repr/time_frame_repr_wide
class Repr:
def time_frame_repr_wide(self):
repr(self.df_wide) | negative_train_query0_01053 | |
asv_bench/benchmarks/frame_methods.py/MaskBool/setup
class MaskBool:
def setup(self):
data = np.random.randn(1000, 500)
df = DataFrame(data)
df = df.where(df > 0)
self.bools = df > 0
self.mask = isnull(df) | negative_train_query0_01054 | |
asv_bench/benchmarks/frame_methods.py/MaskBool/time_frame_mask_bools
class MaskBool:
def time_frame_mask_bools(self):
self.bools.mask(self.mask) | negative_train_query0_01055 | |
asv_bench/benchmarks/frame_methods.py/MaskBool/time_frame_mask_floats
class MaskBool:
def time_frame_mask_floats(self):
self.bools.astype(float).mask(self.mask) | negative_train_query0_01056 | |
asv_bench/benchmarks/frame_methods.py/Isnull/setup
class Isnull:
def setup(self):
N = 10**3
self.df_no_null = DataFrame(np.random.randn(N, N))
sample = np.array([np.nan, 1.0])
data = np.random.choice(sample, (N, N))
self.df = DataFrame(data)
sample = np.array(list(string.ascii_letters + string.whitespace))
data = np.random.choice(sample, (N, N))
self.df_strings = DataFrame(data)
sample = np.array(
[
NaT,
np.nan,
None,
np.datetime64("NaT"),
np.timedelta64("NaT"),
0,
1,
2.0,
"",
"abcd",
]
)
data = np.random.choice(sample, (N, N))
self.df_obj = DataFrame(data) | negative_train_query0_01057 | |
asv_bench/benchmarks/frame_methods.py/Isnull/time_isnull_floats_no_null
class Isnull:
def time_isnull_floats_no_null(self):
isnull(self.df_no_null) | negative_train_query0_01058 | |
asv_bench/benchmarks/frame_methods.py/Isnull/time_isnull
class Isnull:
def time_isnull(self):
isnull(self.df) | negative_train_query0_01059 | |
asv_bench/benchmarks/frame_methods.py/Isnull/time_isnull_strngs
class Isnull:
def time_isnull_strngs(self):
isnull(self.df_strings) | negative_train_query0_01060 | |
asv_bench/benchmarks/frame_methods.py/Isnull/time_isnull_obj
class Isnull:
def time_isnull_obj(self):
isnull(self.df_obj) | negative_train_query0_01061 | |
asv_bench/benchmarks/frame_methods.py/Fillna/setup
class Fillna:
def setup(self, inplace, dtype):
N, M = 10000, 100
if dtype in ("datetime64[ns]", "datetime64[ns, tz]", "timedelta64[ns]"):
data = {
"datetime64[ns]": date_range("2011-01-01", freq="h", periods=N),
"datetime64[ns, tz]": date_range(
"2011-01-01", freq="h", periods=N, tz="Asia/Tokyo"
),
"timedelta64[ns]": timedelta_range(start="1 day", periods=N, freq="1D"),
}
self.df = DataFrame({f"col_{i}": data[dtype] for i in range(M)})
self.df[::2] = None
else:
values = np.random.randn(N, M)
values[::2] = np.nan
if dtype == "Int64":
values = values.round()
self.df = DataFrame(values, dtype=dtype)
self.fill_values = self.df.iloc[self.df.first_valid_index()].to_dict() | negative_train_query0_01062 | |
asv_bench/benchmarks/frame_methods.py/Fillna/time_fillna
class Fillna:
def time_fillna(self, inplace, dtype):
self.df.fillna(value=self.fill_values, inplace=inplace) | negative_train_query0_01063 | |
asv_bench/benchmarks/frame_methods.py/Fillna/time_ffill
class Fillna:
def time_ffill(self, inplace, dtype):
self.df.ffill(inplace=inplace) | negative_train_query0_01064 | |
asv_bench/benchmarks/frame_methods.py/Fillna/time_bfill
class Fillna:
def time_bfill(self, inplace, dtype):
self.df.bfill(inplace=inplace) | negative_train_query0_01065 | |
asv_bench/benchmarks/frame_methods.py/Dropna/setup
class Dropna:
def setup(self, how, axis):
self.df = DataFrame(np.random.randn(10000, 1000))
self.df.iloc[50:1000, 20:50] = np.nan
self.df.iloc[2000:3000] = np.nan
self.df.iloc[:, 60:70] = np.nan
self.df_mixed = self.df.copy()
self.df_mixed["foo"] = "bar" | negative_train_query0_01066 | |
asv_bench/benchmarks/frame_methods.py/Dropna/time_dropna
class Dropna:
def time_dropna(self, how, axis):
self.df.dropna(how=how, axis=axis) | negative_train_query0_01067 | |
asv_bench/benchmarks/frame_methods.py/Dropna/time_dropna_axis_mixed_dtypes
class Dropna:
def time_dropna_axis_mixed_dtypes(self, how, axis):
self.df_mixed.dropna(how=how, axis=axis) | negative_train_query0_01068 | |
asv_bench/benchmarks/frame_methods.py/Isna/setup
class Isna:
def setup(self, dtype):
data = np.random.randn(10000, 1000)
# all-na columns
data[:, 600:800] = np.nan
# partial-na columns
data[800:1000, 4000:5000] = np.nan
self.df = DataFrame(data, dtype=dtype) | negative_train_query0_01069 | |
asv_bench/benchmarks/frame_methods.py/Isna/time_isna
class Isna:
def time_isna(self, dtype):
self.df.isna() | negative_train_query0_01070 | |
asv_bench/benchmarks/frame_methods.py/Count/setup
class Count:
def setup(self, axis):
self.df = DataFrame(np.random.randn(10000, 1000))
self.df.iloc[50:1000, 20:50] = np.nan
self.df.iloc[2000:3000] = np.nan
self.df.iloc[:, 60:70] = np.nan
self.df_mixed = self.df.copy()
self.df_mixed["foo"] = "bar" | negative_train_query0_01071 | |
asv_bench/benchmarks/frame_methods.py/Count/time_count
class Count:
def time_count(self, axis):
self.df.count(axis=axis) | negative_train_query0_01072 | |
asv_bench/benchmarks/frame_methods.py/Count/time_count_mixed_dtypes
class Count:
def time_count_mixed_dtypes(self, axis):
self.df_mixed.count(axis=axis) | negative_train_query0_01073 | |
asv_bench/benchmarks/frame_methods.py/Apply/setup
class Apply:
def setup(self):
self.df = DataFrame(np.random.randn(1000, 100))
self.s = Series(np.arange(1028.0))
self.df2 = DataFrame({i: self.s for i in range(1028)})
self.df3 = DataFrame(np.random.randn(1000, 3), columns=list("ABC")) | negative_train_query0_01074 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_user_func
class Apply:
def time_apply_user_func(self):
self.df2.apply(lambda x: np.corrcoef(x, self.s)[(0, 1)]) | negative_train_query0_01075 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_axis_1
class Apply:
def time_apply_axis_1(self):
self.df.apply(lambda x: x + 1, axis=1) | negative_train_query0_01076 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_lambda_mean
class Apply:
def time_apply_lambda_mean(self):
self.df.apply(lambda x: x.mean()) | negative_train_query0_01077 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_str_mean
class Apply:
def time_apply_str_mean(self):
self.df.apply("mean") | negative_train_query0_01078 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_pass_thru
class Apply:
def time_apply_pass_thru(self):
self.df.apply(lambda x: x) | negative_train_query0_01079 | |
asv_bench/benchmarks/frame_methods.py/Apply/time_apply_ref_by_name
class Apply:
def time_apply_ref_by_name(self):
self.df3.apply(lambda x: x["A"] + x["B"], axis=1) | negative_train_query0_01080 | |
asv_bench/benchmarks/frame_methods.py/Dtypes/setup
class Dtypes:
def setup(self):
self.df = DataFrame(np.random.randn(1000, 1000)) | negative_train_query0_01081 | |
asv_bench/benchmarks/frame_methods.py/Dtypes/time_frame_dtypes
class Dtypes:
def time_frame_dtypes(self):
self.df.dtypes | negative_train_query0_01082 | |
asv_bench/benchmarks/frame_methods.py/Equals/setup
class Equals:
def setup(self):
N = 10**3
self.float_df = DataFrame(np.random.randn(N, N))
self.float_df_nan = self.float_df.copy()
self.float_df_nan.iloc[-1, -1] = np.nan
self.object_df = DataFrame("foo", index=range(N), columns=range(N))
self.object_df_nan = self.object_df.copy()
self.object_df_nan.iloc[-1, -1] = np.nan
self.nonunique_cols = self.object_df.copy()
self.nonunique_cols.columns = ["A"] * len(self.nonunique_cols.columns)
self.nonunique_cols_nan = self.nonunique_cols.copy()
self.nonunique_cols_nan.iloc[-1, -1] = np.nan | negative_train_query0_01083 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_float_equal
class Equals:
def time_frame_float_equal(self):
self.float_df.equals(self.float_df) | negative_train_query0_01084 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_float_unequal
class Equals:
def time_frame_float_unequal(self):
self.float_df.equals(self.float_df_nan) | negative_train_query0_01085 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_nonunique_equal
class Equals:
def time_frame_nonunique_equal(self):
self.nonunique_cols.equals(self.nonunique_cols) | negative_train_query0_01086 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_nonunique_unequal
class Equals:
def time_frame_nonunique_unequal(self):
self.nonunique_cols.equals(self.nonunique_cols_nan) | negative_train_query0_01087 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_object_equal
class Equals:
def time_frame_object_equal(self):
self.object_df.equals(self.object_df) | negative_train_query0_01088 | |
asv_bench/benchmarks/frame_methods.py/Equals/time_frame_object_unequal
class Equals:
def time_frame_object_unequal(self):
self.object_df.equals(self.object_df_nan) | negative_train_query0_01089 | |
asv_bench/benchmarks/frame_methods.py/Interpolate/setup
class Interpolate:
def setup(self):
N = 10000
# this is the worst case, where every column has NaNs.
arr = np.random.randn(N, 100)
arr[::2] = np.nan
self.df = DataFrame(arr)
self.df2 = DataFrame(
{
"A": np.arange(0, N),
"B": np.random.randint(0, 100, N),
"C": np.random.randn(N),
"D": np.random.randn(N),
}
)
self.df2.loc[1::5, "A"] = np.nan
self.df2.loc[1::5, "C"] = np.nan | negative_train_query0_01090 | |
asv_bench/benchmarks/frame_methods.py/Interpolate/time_interpolate
class Interpolate:
def time_interpolate(self):
self.df.interpolate() | negative_train_query0_01091 | |
asv_bench/benchmarks/frame_methods.py/Interpolate/time_interpolate_some_good
class Interpolate:
def time_interpolate_some_good(self):
self.df2.interpolate() | negative_train_query0_01092 | |
asv_bench/benchmarks/frame_methods.py/Shift/setup
class Shift:
def setup(self, axis):
self.df = DataFrame(np.random.rand(10000, 500)) | negative_train_query0_01093 | |
asv_bench/benchmarks/frame_methods.py/Shift/time_shift
class Shift:
def time_shift(self, axis):
self.df.shift(1, axis=axis) | negative_train_query0_01094 | |
asv_bench/benchmarks/frame_methods.py/Nunique/setup
class Nunique:
def setup(self):
self.df = DataFrame(np.random.randn(10000, 1000)) | negative_train_query0_01095 | |
asv_bench/benchmarks/frame_methods.py/Nunique/time_frame_nunique
class Nunique:
def time_frame_nunique(self):
self.df.nunique() | negative_train_query0_01096 | |
asv_bench/benchmarks/frame_methods.py/SeriesNuniqueWithNan/setup
class SeriesNuniqueWithNan:
def setup(self):
values = 100 * [np.nan] + list(range(100))
self.ser = Series(np.tile(values, 10000), dtype=float) | negative_train_query0_01097 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.