title stringclasses 1 value | text stringlengths 30 426k | id stringlengths 27 30 |
|---|---|---|
asv_bench/benchmarks/inference.py/ToDatetimeCache/time_dup_string_tzoffset_dates
class ToDatetimeCache:
def time_dup_string_tzoffset_dates(self, cache):
to_datetime(self.dup_string_with_tz, cache=cache) | negative_train_query0_00598 | |
asv_bench/benchmarks/inference.py/ToTimedelta/setup
class ToTimedelta:
def setup(self):
self.ints = np.random.randint(0, 60, size=10000)
self.str_days = []
self.str_seconds = []
for i in self.ints:
self.str_days.append(f"{i} days")
self.str_seconds.append(f"00:00:{i:02d}") | negative_train_query0_00599 | |
asv_bench/benchmarks/inference.py/ToTimedelta/time_convert_int
class ToTimedelta:
def time_convert_int(self):
to_timedelta(self.ints, unit="s") | negative_train_query0_00600 | |
asv_bench/benchmarks/inference.py/ToTimedelta/time_convert_string_days
class ToTimedelta:
def time_convert_string_days(self):
to_timedelta(self.str_days) | negative_train_query0_00601 | |
asv_bench/benchmarks/inference.py/ToTimedelta/time_convert_string_seconds
class ToTimedelta:
def time_convert_string_seconds(self):
to_timedelta(self.str_seconds) | negative_train_query0_00602 | |
asv_bench/benchmarks/inference.py/ToTimedeltaErrors/setup
class ToTimedeltaErrors:
def setup(self):
ints = np.random.randint(0, 60, size=10000)
self.arr = [f"{i} days" for i in ints]
self.arr[-1] = "apple" | negative_train_query0_00603 | |
asv_bench/benchmarks/inference.py/ToTimedeltaErrors/time_convert
class ToTimedeltaErrors:
def time_convert(self):
to_timedelta(self.arr, errors="coerce") | negative_train_query0_00604 | |
asv_bench/benchmarks/index_object.py/SetOperations/setup
class SetOperations:
def setup(self, index_structure, dtype, method):
N = 10**5
dates_left = date_range("1/1/2000", periods=N, freq="min")
fmt = "%Y-%m-%d %H:%M:%S"
date_str_left = Index(dates_left.strftime(fmt))
int_left = Index(np.arange(N))
ea_int_left = Index(np.arange(N), dtype="Int64")
str_left = Index([f"i-{i}" for i in range(N)], dtype=object)
data = {
"datetime": dates_left,
"date_string": date_str_left,
"int": int_left,
"strings": str_left,
"ea_int": ea_int_left,
}
if index_structure == "non_monotonic":
data = {k: mi[::-1] for k, mi in data.items()}
data = {k: {"left": idx, "right": idx[:-1]} for k, idx in data.items()}
self.left = data[dtype]["left"]
self.right = data[dtype]["right"] | negative_train_query0_00605 | |
asv_bench/benchmarks/index_object.py/SetOperations/time_operation
class SetOperations:
def time_operation(self, index_structure, dtype, method):
getattr(self.left, method)(self.right) | negative_train_query0_00606 | |
asv_bench/benchmarks/index_object.py/SetDisjoint/setup
class SetDisjoint:
def setup(self):
N = 10**5
B = N + 20000
self.datetime_left = DatetimeIndex(range(N))
self.datetime_right = DatetimeIndex(range(N, B)) | negative_train_query0_00607 | |
asv_bench/benchmarks/index_object.py/SetDisjoint/time_datetime_difference_disjoint
class SetDisjoint:
def time_datetime_difference_disjoint(self):
self.datetime_left.difference(self.datetime_right) | negative_train_query0_00608 | |
asv_bench/benchmarks/index_object.py/UnionWithDuplicates/setup
class UnionWithDuplicates:
def setup(self):
self.left = Index(np.repeat(np.arange(1000), 100))
self.right = Index(np.tile(np.arange(500, 1500), 50)) | negative_train_query0_00609 | |
asv_bench/benchmarks/index_object.py/UnionWithDuplicates/time_union_with_duplicates
class UnionWithDuplicates:
def time_union_with_duplicates(self):
self.left.union(self.right) | negative_train_query0_00610 | |
asv_bench/benchmarks/index_object.py/Range/setup
class Range:
def setup(self):
self.idx_inc = RangeIndex(start=0, stop=10**6, step=3)
self.idx_dec = RangeIndex(start=10**6, stop=-1, step=-3) | negative_train_query0_00611 | |
asv_bench/benchmarks/index_object.py/Range/time_max
class Range:
def time_max(self):
self.idx_inc.max() | negative_train_query0_00612 | |
asv_bench/benchmarks/index_object.py/Range/time_max_trivial
class Range:
def time_max_trivial(self):
self.idx_dec.max() | negative_train_query0_00613 | |
asv_bench/benchmarks/index_object.py/Range/time_min
class Range:
def time_min(self):
self.idx_dec.min() | negative_train_query0_00614 | |
asv_bench/benchmarks/index_object.py/Range/time_min_trivial
class Range:
def time_min_trivial(self):
self.idx_inc.min() | negative_train_query0_00615 | |
asv_bench/benchmarks/index_object.py/Range/time_get_loc_inc
class Range:
def time_get_loc_inc(self):
self.idx_inc.get_loc(900_000) | negative_train_query0_00616 | |
asv_bench/benchmarks/index_object.py/Range/time_get_loc_dec
class Range:
def time_get_loc_dec(self):
self.idx_dec.get_loc(100_000) | negative_train_query0_00617 | |
asv_bench/benchmarks/index_object.py/Range/time_iter_inc
class Range:
def time_iter_inc(self):
for _ in self.idx_inc:
pass | negative_train_query0_00618 | |
asv_bench/benchmarks/index_object.py/Range/time_iter_dec
class Range:
def time_iter_dec(self):
for _ in self.idx_dec:
pass | negative_train_query0_00619 | |
asv_bench/benchmarks/index_object.py/Range/time_sort_values_asc
class Range:
def time_sort_values_asc(self):
self.idx_inc.sort_values() | negative_train_query0_00620 | |
asv_bench/benchmarks/index_object.py/Range/time_sort_values_des
class Range:
def time_sort_values_des(self):
self.idx_inc.sort_values(ascending=False) | negative_train_query0_00621 | |
asv_bench/benchmarks/index_object.py/IndexEquals/setup
class IndexEquals:
def setup(self):
idx_large_fast = RangeIndex(100_000)
idx_small_slow = date_range(start="1/1/2012", periods=1)
self.mi_large_slow = MultiIndex.from_product([idx_large_fast, idx_small_slow])
self.idx_non_object = RangeIndex(1) | negative_train_query0_00622 | |
asv_bench/benchmarks/index_object.py/IndexEquals/time_non_object_equals_multiindex
class IndexEquals:
def time_non_object_equals_multiindex(self):
self.idx_non_object.equals(self.mi_large_slow) | negative_train_query0_00623 | |
asv_bench/benchmarks/index_object.py/IndexAppend/setup
class IndexAppend:
def setup(self):
N = 10_000
self.range_idx = RangeIndex(0, 100)
self.int_idx = self.range_idx.astype(int)
self.obj_idx = self.int_idx.astype(str)
self.range_idxs = []
self.int_idxs = []
self.object_idxs = []
for i in range(1, N):
r_idx = RangeIndex(i * 100, (i + 1) * 100)
self.range_idxs.append(r_idx)
i_idx = r_idx.astype(int)
self.int_idxs.append(i_idx)
o_idx = i_idx.astype(str)
self.object_idxs.append(o_idx)
self.same_range_idx = [self.range_idx] * N | negative_train_query0_00624 | |
asv_bench/benchmarks/index_object.py/IndexAppend/time_append_range_list
class IndexAppend:
def time_append_range_list(self):
self.range_idx.append(self.range_idxs) | negative_train_query0_00625 | |
asv_bench/benchmarks/index_object.py/IndexAppend/time_append_range_list_same
class IndexAppend:
def time_append_range_list_same(self):
self.range_idx.append(self.same_range_idx) | negative_train_query0_00626 | |
asv_bench/benchmarks/index_object.py/IndexAppend/time_append_int_list
class IndexAppend:
def time_append_int_list(self):
self.int_idx.append(self.int_idxs) | negative_train_query0_00627 | |
asv_bench/benchmarks/index_object.py/IndexAppend/time_append_obj_list
class IndexAppend:
def time_append_obj_list(self):
self.obj_idx.append(self.object_idxs) | negative_train_query0_00628 | |
asv_bench/benchmarks/index_object.py/Indexing/setup
class Indexing:
def setup(self, dtype):
N = 10**6
if dtype == "String":
self.idx = Index([f"i-{i}" for i in range(N)], dtype=object)
elif dtype == "Float":
self.idx = Index(np.arange(N), dtype=np.float64)
elif dtype == "Int":
self.idx = Index(np.arange(N), dtype=np.int64)
self.array_mask = (np.arange(N) % 3) == 0
self.series_mask = Series(self.array_mask)
self.sorted = self.idx.sort_values()
half = N // 2
self.non_unique = self.idx[:half].append(self.idx[:half])
self.non_unique_sorted = self.sorted[:half].repeat(2)
self.key = self.sorted[N // 4] | negative_train_query0_00629 | |
asv_bench/benchmarks/index_object.py/Indexing/time_boolean_array
class Indexing:
def time_boolean_array(self, dtype):
self.idx[self.array_mask] | negative_train_query0_00630 | |
asv_bench/benchmarks/index_object.py/Indexing/time_boolean_series
class Indexing:
def time_boolean_series(self, dtype):
self.idx[self.series_mask] | negative_train_query0_00631 | |
asv_bench/benchmarks/index_object.py/Indexing/time_get
class Indexing:
def time_get(self, dtype):
self.idx[1] | negative_train_query0_00632 | |
asv_bench/benchmarks/index_object.py/Indexing/time_slice
class Indexing:
def time_slice(self, dtype):
self.idx[:-1] | negative_train_query0_00633 | |
asv_bench/benchmarks/index_object.py/Indexing/time_slice_step
class Indexing:
def time_slice_step(self, dtype):
self.idx[::2] | negative_train_query0_00634 | |
asv_bench/benchmarks/index_object.py/Indexing/time_get_loc
class Indexing:
def time_get_loc(self, dtype):
self.idx.get_loc(self.key) | negative_train_query0_00635 | |
asv_bench/benchmarks/index_object.py/Indexing/time_get_loc_sorted
class Indexing:
def time_get_loc_sorted(self, dtype):
self.sorted.get_loc(self.key) | negative_train_query0_00636 | |
asv_bench/benchmarks/index_object.py/Indexing/time_get_loc_non_unique
class Indexing:
def time_get_loc_non_unique(self, dtype):
self.non_unique.get_loc(self.key) | negative_train_query0_00637 | |
asv_bench/benchmarks/index_object.py/Indexing/time_get_loc_non_unique_sorted
class Indexing:
def time_get_loc_non_unique_sorted(self, dtype):
self.non_unique_sorted.get_loc(self.key) | negative_train_query0_00638 | |
asv_bench/benchmarks/index_object.py/Float64IndexMethod/setup
class Float64IndexMethod:
def setup(self):
N = 100_000
a = np.arange(N, dtype=np.float64)
self.ind = Index(a * 4.8000000418824129e-08) | negative_train_query0_00639 | |
asv_bench/benchmarks/index_object.py/Float64IndexMethod/time_get_loc
class Float64IndexMethod:
def time_get_loc(self):
self.ind.get_loc(0) | negative_train_query0_00640 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/setup
class IntervalIndexMethod:
def setup(self, N):
left = np.append(np.arange(N), np.array(0))
right = np.append(np.arange(1, N + 1), np.array(1))
self.intv = IntervalIndex.from_arrays(left, right)
self.intv._engine
self.intv2 = IntervalIndex.from_arrays(left + 1, right + 1)
self.intv2._engine
self.left = IntervalIndex.from_breaks(np.arange(N))
self.right = IntervalIndex.from_breaks(np.arange(N - 3, 2 * N - 3)) | negative_train_query0_00641 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/time_monotonic_inc
class IntervalIndexMethod:
def time_monotonic_inc(self, N):
self.intv.is_monotonic_increasing | negative_train_query0_00642 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/time_is_unique
class IntervalIndexMethod:
def time_is_unique(self, N):
self.intv.is_unique | negative_train_query0_00643 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/time_intersection
class IntervalIndexMethod:
def time_intersection(self, N):
self.left.intersection(self.right) | negative_train_query0_00644 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/time_intersection_one_duplicate
class IntervalIndexMethod:
def time_intersection_one_duplicate(self, N):
self.intv.intersection(self.right) | negative_train_query0_00645 | |
asv_bench/benchmarks/index_object.py/IntervalIndexMethod/time_intersection_both_duplicate
class IntervalIndexMethod:
def time_intersection_both_duplicate(self, N):
self.intv.intersection(self.intv2) | negative_train_query0_00646 | |
asv_bench/benchmarks/index_object.py/GC/create_use_drop
class GC:
def create_use_drop(self):
idx = Index(list(range(1_000_000)))
idx._engine | negative_train_query0_00647 | |
asv_bench/benchmarks/index_object.py/GC/peakmem_gc_instances
class GC:
def peakmem_gc_instances(self, N):
try:
gc.disable()
for _ in range(N):
self.create_use_drop()
finally:
gc.enable() | negative_train_query0_00648 | |
asv_bench/benchmarks/package.py/TimeImport/time_import
class TimeImport:
def time_import(self):
# on py37+ we the "-X importtime" usage gives us a more precise
# measurement of the import time we actually care about,
# without the subprocess or interpreter overhead
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"]
p = subprocess.run(cmd, stderr=subprocess.PIPE, check=True)
line = p.stderr.splitlines()[-1]
field = line.split(b"|")[-2].strip()
total = int(field) # microseconds
return total | negative_train_query0_00649 | |
asv_bench/benchmarks/stat_ops.py/FrameOps/setup
class FrameOps:
def setup(self, op, dtype, axis):
values = np.random.randn(100000, 4)
if dtype == "Int64":
values = values.astype(int)
df = pd.DataFrame(values).astype(dtype)
self.df_func = getattr(df, op) | negative_train_query0_00650 | |
asv_bench/benchmarks/stat_ops.py/FrameOps/time_op
class FrameOps:
def time_op(self, op, dtype, axis):
self.df_func(axis=axis) | negative_train_query0_00651 | |
asv_bench/benchmarks/stat_ops.py/FrameMixedDtypesOps/setup
class FrameMixedDtypesOps:
def setup(self, op, axis):
if op in ("sum", "skew", "kurt", "prod", "sem", "var") or (
(op, axis)
in (
("mean", 1),
("mean", None),
("median", 1),
("median", None),
("std", 1),
("std", None),
)
):
# Skipping cases where datetime aggregations are not implemented
raise NotImplementedError
N = 1_000_000
df = pd.DataFrame(
{
"f": np.random.normal(0.0, 1.0, N),
"i": np.random.randint(0, N, N),
"ts": pd.date_range(start="1/1/2000", periods=N, freq="h"),
}
)
self.df_func = getattr(df, op) | negative_train_query0_00652 | |
asv_bench/benchmarks/stat_ops.py/FrameMixedDtypesOps/time_op
class FrameMixedDtypesOps:
def time_op(self, op, axis):
self.df_func(axis=axis) | negative_train_query0_00653 | |
asv_bench/benchmarks/stat_ops.py/FrameMultiIndexOps/setup
class FrameMultiIndexOps:
def setup(self, op):
levels = [np.arange(10), np.arange(100), np.arange(100)]
codes = [
np.arange(10).repeat(10000),
np.tile(np.arange(100).repeat(100), 10),
np.tile(np.tile(np.arange(100), 100), 10),
]
index = pd.MultiIndex(levels=levels, codes=codes)
df = pd.DataFrame(np.random.randn(len(index), 4), index=index)
self.df_func = getattr(df, op) | negative_train_query0_00654 | |
asv_bench/benchmarks/stat_ops.py/FrameMultiIndexOps/time_op
class FrameMultiIndexOps:
def time_op(self, op):
self.df_func() | negative_train_query0_00655 | |
asv_bench/benchmarks/stat_ops.py/SeriesOps/setup
class SeriesOps:
def setup(self, op, dtype):
s = pd.Series(np.random.randn(100000)).astype(dtype)
self.s_func = getattr(s, op) | negative_train_query0_00656 | |
asv_bench/benchmarks/stat_ops.py/SeriesOps/time_op
class SeriesOps:
def time_op(self, op, dtype):
self.s_func() | negative_train_query0_00657 | |
asv_bench/benchmarks/stat_ops.py/SeriesMultiIndexOps/setup
class SeriesMultiIndexOps:
def setup(self, op):
levels = [np.arange(10), np.arange(100), np.arange(100)]
codes = [
np.arange(10).repeat(10000),
np.tile(np.arange(100).repeat(100), 10),
np.tile(np.tile(np.arange(100), 100), 10),
]
index = pd.MultiIndex(levels=levels, codes=codes)
s = pd.Series(np.random.randn(len(index)), index=index)
self.s_func = getattr(s, op) | negative_train_query0_00658 | |
asv_bench/benchmarks/stat_ops.py/SeriesMultiIndexOps/time_op
class SeriesMultiIndexOps:
def time_op(self, op):
self.s_func() | negative_train_query0_00659 | |
asv_bench/benchmarks/stat_ops.py/Rank/setup
class Rank:
def setup(self, constructor, pct):
values = np.random.randn(10**5)
self.data = getattr(pd, constructor)(values) | negative_train_query0_00660 | |
asv_bench/benchmarks/stat_ops.py/Rank/time_rank
class Rank:
def time_rank(self, constructor, pct):
self.data.rank(pct=pct) | negative_train_query0_00661 | |
asv_bench/benchmarks/stat_ops.py/Rank/time_average_old
class Rank:
def time_average_old(self, constructor, pct):
self.data.rank(pct=pct) / len(self.data) | negative_train_query0_00662 | |
asv_bench/benchmarks/stat_ops.py/Correlation/setup
class Correlation:
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)) | negative_train_query0_00663 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corr
class Correlation:
def time_corr(self, method):
self.df.corr(method=method) | negative_train_query0_00664 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corr_wide
class Correlation:
def time_corr_wide(self, method):
self.df_wide.corr(method=method) | negative_train_query0_00665 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corr_wide_nans
class Correlation:
def time_corr_wide_nans(self, method):
self.df_wide_nans.corr(method=method) | negative_train_query0_00666 | |
asv_bench/benchmarks/stat_ops.py/Correlation/peakmem_corr_wide
class Correlation:
def peakmem_corr_wide(self, method):
self.df_wide.corr(method=method) | negative_train_query0_00667 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corr_series
class Correlation:
def time_corr_series(self, method):
self.s.corr(self.s2, method=method) | negative_train_query0_00668 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corrwith_cols
class Correlation:
def time_corrwith_cols(self, method):
self.df.corrwith(self.df2, method=method) | negative_train_query0_00669 | |
asv_bench/benchmarks/stat_ops.py/Correlation/time_corrwith_rows
class Correlation:
def time_corrwith_rows(self, method):
self.df.corrwith(self.df2, axis=1, method=method) | negative_train_query0_00670 | |
asv_bench/benchmarks/stat_ops.py/Covariance/setup
class Covariance:
def setup(self):
self.s = pd.Series(np.random.randn(100000))
self.s2 = pd.Series(np.random.randn(100000)) | negative_train_query0_00671 | |
asv_bench/benchmarks/stat_ops.py/Covariance/time_cov_series
class Covariance:
def time_cov_series(self):
self.s.cov(self.s2) | negative_train_query0_00672 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/setup
class NumericSeriesIndexing:
def setup(self, dtype, index_structure):
N = 10**6
indices = {
"unique_monotonic_inc": Index(range(N), dtype=dtype),
"nonunique_monotonic_inc": Index(
list(range(55)) + [54] + list(range(55, N - 1)), dtype=dtype
),
}
self.data = Series(np.random.rand(N), index=indices[index_structure])
self.array = np.arange(10000)
self.array_list = self.array.tolist() | negative_train_query0_00673 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_getitem_scalar
class NumericSeriesIndexing:
def time_getitem_scalar(self, index, index_structure):
self.data[800000] | negative_train_query0_00674 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_getitem_slice
class NumericSeriesIndexing:
def time_getitem_slice(self, index, index_structure):
self.data[:800000] | negative_train_query0_00675 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_getitem_list_like
class NumericSeriesIndexing:
def time_getitem_list_like(self, index, index_structure):
self.data[[800000]] | negative_train_query0_00676 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_getitem_array
class NumericSeriesIndexing:
def time_getitem_array(self, index, index_structure):
self.data[self.array] | negative_train_query0_00677 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_getitem_lists
class NumericSeriesIndexing:
def time_getitem_lists(self, index, index_structure):
self.data[self.array_list] | negative_train_query0_00678 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_iloc_array
class NumericSeriesIndexing:
def time_iloc_array(self, index, index_structure):
self.data.iloc[self.array] | negative_train_query0_00679 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_iloc_list_like
class NumericSeriesIndexing:
def time_iloc_list_like(self, index, index_structure):
self.data.iloc[[800000]] | negative_train_query0_00680 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_iloc_scalar
class NumericSeriesIndexing:
def time_iloc_scalar(self, index, index_structure):
self.data.iloc[800000] | negative_train_query0_00681 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_iloc_slice
class NumericSeriesIndexing:
def time_iloc_slice(self, index, index_structure):
self.data.iloc[:800000] | negative_train_query0_00682 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_loc_array
class NumericSeriesIndexing:
def time_loc_array(self, index, index_structure):
self.data.loc[self.array] | negative_train_query0_00683 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_loc_list_like
class NumericSeriesIndexing:
def time_loc_list_like(self, index, index_structure):
self.data.loc[[800000]] | negative_train_query0_00684 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_loc_scalar
class NumericSeriesIndexing:
def time_loc_scalar(self, index, index_structure):
self.data.loc[800000] | negative_train_query0_00685 | |
asv_bench/benchmarks/indexing.py/NumericSeriesIndexing/time_loc_slice
class NumericSeriesIndexing:
def time_loc_slice(self, index, index_structure):
self.data.loc[:800000] | negative_train_query0_00686 | |
asv_bench/benchmarks/indexing.py/NumericMaskedIndexing/setup
class NumericMaskedIndexing:
def setup(self, dtype, monotonic):
indices = {
True: Index(self.monotonic_list, dtype=dtype),
False: Index(self.non_monotonic_list, dtype=dtype).append(
Index([NA], dtype=dtype)
),
}
self.data = indices[monotonic]
self.indexer = np.arange(300, 1_000)
self.data_dups = self.data.append(self.data) | negative_train_query0_00687 | |
asv_bench/benchmarks/indexing.py/NumericMaskedIndexing/time_get_indexer
class NumericMaskedIndexing:
def time_get_indexer(self, dtype, monotonic):
self.data.get_indexer(self.indexer) | negative_train_query0_00688 | |
asv_bench/benchmarks/indexing.py/NumericMaskedIndexing/time_get_indexer_dups
class NumericMaskedIndexing:
def time_get_indexer_dups(self, dtype, monotonic):
self.data.get_indexer_for(self.indexer) | negative_train_query0_00689 | |
asv_bench/benchmarks/indexing.py/NonNumericSeriesIndexing/setup
class NonNumericSeriesIndexing:
def setup(self, index, index_structure):
N = 10**6
if index == "string":
index = Index([f"i-{i}" for i in range(N)], dtype=object)
elif index == "datetime":
index = date_range("1900", periods=N, freq="s")
elif index == "period":
index = period_range("1900", periods=N, freq="s")
index = index.sort_values()
assert index.is_unique and index.is_monotonic_increasing
if index_structure == "nonunique_monotonic_inc":
index = index.insert(item=index[2], loc=2)[:-1]
elif index_structure == "non_monotonic":
index = index[::2].append(index[1::2])
assert len(index) == N
self.s = Series(np.random.rand(N), index=index)
self.lbl = index[80000]
# warm up index mapping
self.s[self.lbl] | negative_train_query0_00690 | |
asv_bench/benchmarks/indexing.py/NonNumericSeriesIndexing/time_getitem_label_slice
class NonNumericSeriesIndexing:
def time_getitem_label_slice(self, index, index_structure):
self.s[: self.lbl] | negative_train_query0_00691 | |
asv_bench/benchmarks/indexing.py/NonNumericSeriesIndexing/time_getitem_pos_slice
class NonNumericSeriesIndexing:
def time_getitem_pos_slice(self, index, index_structure):
self.s[:80000] | negative_train_query0_00692 | |
asv_bench/benchmarks/indexing.py/NonNumericSeriesIndexing/time_getitem_scalar
class NonNumericSeriesIndexing:
def time_getitem_scalar(self, index, index_structure):
self.s[self.lbl] | negative_train_query0_00693 | |
asv_bench/benchmarks/indexing.py/NonNumericSeriesIndexing/time_getitem_list_like
class NonNumericSeriesIndexing:
def time_getitem_list_like(self, index, index_structure):
self.s[[self.lbl]] | negative_train_query0_00694 | |
asv_bench/benchmarks/indexing.py/DataFrameStringIndexing/setup
class DataFrameStringIndexing:
def setup(self):
index = Index([f"i-{i}" for i in range(1000)], dtype=object)
columns = Index([f"i-{i}" for i in range(30)], dtype=object)
with warnings.catch_warnings(record=True):
self.df = DataFrame(np.random.randn(1000, 30), index=index, columns=columns)
self.idx_scalar = index[100]
self.col_scalar = columns[10]
self.bool_indexer = self.df[self.col_scalar] > 0
self.bool_obj_indexer = self.bool_indexer.astype(object)
self.boolean_indexer = (self.df[self.col_scalar] > 0).astype("boolean") | negative_train_query0_00695 | |
asv_bench/benchmarks/indexing.py/DataFrameStringIndexing/time_loc
class DataFrameStringIndexing:
def time_loc(self):
self.df.loc[self.idx_scalar, self.col_scalar] | negative_train_query0_00696 | |
asv_bench/benchmarks/indexing.py/DataFrameStringIndexing/time_at
class DataFrameStringIndexing:
def time_at(self):
self.df.at[self.idx_scalar, self.col_scalar] | negative_train_query0_00697 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.