id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,800 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.SetCategories | import pandas as pd
import numpy as np
class SetCategories:
def setup(self):
n = 5 * 10 ** 5
arr = [f's{i:04d}' for i in np.random.randint(0, n // 10, size=n)]
self.ts = pd.Series(arr).astype('category')
def time_set_categories(self):
self.ts.cat.set_categories(self.ts.cat.cat... |
class SetCategories:
def setup(self):
pass
def time_set_categories(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 8 | 1 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,801 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/categoricals.py | benchmarks.categoricals.ValueCounts | import pandas as pd
import numpy as np
class ValueCounts:
params = [True, False]
param_names = ['dropna']
def setup(self, dropna):
n = 5 * 10 ** 5
arr = [f's{i:04d}' for i in np.random.randint(0, n // 10, size=n)]
self.ts = pd.Series(arr).astype('category')
def time_value_coun... |
class ValueCounts:
def setup(self, dropna):
pass
def time_value_counts(self, dropna):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 11 | 2 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
6,802 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/ctors.py | benchmarks.ctors.DatetimeIndexConstructor | from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range
class DatetimeIndexConstructor:
def setup(self):
N = 20000
dti = date_range('1900-01-01', periods=N)
self.list_of_timestamps = dti.tolist()
self.list_of_dates = dti.date.tolist()
self.list_of... |
class DatetimeIndexConstructor:
def setup(self):
pass
def time_from_list_of_timestamps(self):
pass
def time_from_list_of_dates(self):
pass
def time_from_list_of_datetimes(self):
pass
def time_from_list_of_str(self):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 4 | 5 | 5 | 21 | 5 | 16 | 12 | 10 | 0 | 16 | 12 | 10 | 1 | 0 | 0 | 5 |
6,803 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/ctors.py | benchmarks.ctors.MultiIndexConstructor | from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range
class MultiIndexConstructor:
def setup(self):
N = 10 ** 4
self.iterables = [Index([f'i-{i}' for i in range(N)], dtype=object), range(20)]
def time_multiindex_from_iterables(self):
MultiIndex.from_produc... |
class MultiIndexConstructor:
def setup(self):
pass
def time_multiindex_from_iterables(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,804 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/ctors.py | benchmarks.ctors.SeriesConstructors | from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range
import numpy as np
class SeriesConstructors:
param_names = ['data_fmt', 'with_index', 'dtype']
params = [[no_change, list, list_of_str, gen_of_str, arr_dict, list_of_tuples, gen_of_tuples, list_of_lists, list_of_tuples_with_none... |
class SeriesConstructors:
def setup(self, data_fmt, with_index, dtype):
pass
def time_series_constructor(self, data_fmt, with_index, dtype):
pass | 3 | 0 | 7 | 0 | 7 | 0 | 3 | 0.03 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 38 | 3 | 34 | 11 | 31 | 1 | 16 | 11 | 13 | 4 | 0 | 1 | 5 |
6,805 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/ctors.py | benchmarks.ctors.SeriesDtypesConstructors | from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp, date_range
import numpy as np
class SeriesDtypesConstructors:
def setup(self):
N = 10 ** 4
self.arr = np.random.randn(N)
self.arr_str = np.array(['foo', 'bar', 'baz'], dtype=object)
self.s = Series([Timestamp('... |
class SeriesDtypesConstructors:
def setup(self):
pass
def time_index_from_array_string(self):
pass
def time_index_from_array_floats(self):
pass
def time_dtindex_from_series(self):
pass
def time_dtindex_from_index_with_series(self):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 5 | 3 | 5 | 5 | 22 | 4 | 18 | 10 | 12 | 0 | 14 | 10 | 8 | 1 | 0 | 0 | 5 |
6,806 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/dtypes.py | benchmarks.dtypes.CheckDtypes | import numpy as np
import pandas as pd
from pandas.api.types import is_extension_array_dtype, pandas_dtype
class CheckDtypes:
def setup(self):
self.ext_dtype = pd.Int64Dtype()
self.np_dtype = np.dtype('int64')
def time_is_extension_array_dtype_true(self):
is_extension_array_dtype(self... |
class CheckDtypes:
def setup(self):
pass
def time_is_extension_array_dtype_true(self):
pass
def time_is_extension_array_dtype_false(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 10 | 2 | 8 | 6 | 4 | 0 | 8 | 6 | 4 | 1 | 0 | 0 | 3 |
6,807 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/dtypes.py | benchmarks.dtypes.Dtypes | from pandas.api.types import is_extension_array_dtype, pandas_dtype
class Dtypes:
params = _dtypes + [dt.name for dt in _dtypes]
param_names = ['dtype']
def time_pandas_dtype(self, dtype):
pandas_dtype(dtype) |
class Dtypes:
def time_pandas_dtype(self, dtype):
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 6 | 1 | 5 | 4 | 3 | 0 | 5 | 4 | 3 | 1 | 0 | 0 | 1 |
6,808 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/dtypes.py | benchmarks.dtypes.DtypesInvalid | import numpy as np
from pandas.api.types import is_extension_array_dtype, pandas_dtype
class DtypesInvalid:
param_names = ['dtype']
params = ['scalar-string', 'scalar-int', 'list-string', 'array-string']
data_dict = {'scalar-string': 'foo', 'scalar-int': 1, 'list-string': ['foo'] * 1000, 'array-string': np... |
class DtypesInvalid:
def time_pandas_dtype_invalid(self, dtype):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 15 | 1 | 14 | 5 | 12 | 0 | 9 | 5 | 7 | 2 | 0 | 1 | 2 |
6,809 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/dtypes.py | benchmarks.dtypes.SelectDtypes | import string
import pandas._testing as tm
from pandas import DataFrame, Index
import numpy as np
class SelectDtypes:
try:
params = [tm.ALL_INT_NUMPY_DTYPES + tm.ALL_INT_EA_DTYPES + tm.FLOAT_NUMPY_DTYPES + tm.COMPLEX_DTYPES + tm.DATETIME64_DTYPES + tm.TIMEDELTA64_DTYPES + tm.BOOL_DTYPES]
except Attribu... |
class SelectDtypes:
def setup(self, dtype):
pass
def create_df(data):
pass
def time_select_dtype_int_include(self, dtype):
pass
def time_select_dtype_int_exclude(self, dtype):
pass
def time_select_dtype_float_include(self, dtype):
pass
d... | 11 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 9 | 6 | 9 | 9 | 61 | 11 | 50 | 20 | 39 | 0 | 32 | 20 | 21 | 1 | 0 | 1 | 10 |
6,810 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/eval.py | benchmarks.eval.Eval | import pandas as pd
import numpy as np
class Eval:
params = [['numexpr', 'python'], [1, 'all']]
param_names = ['engine', 'threads']
def setup(self, engine, threads):
self.df = pd.DataFrame(np.random.randn(20000, 100))
self.df2 = pd.DataFrame(np.random.randn(20000, 100))
self.df3 = ... |
class Eval:
def setup(self, engine, threads):
pass
def time_add(self, engine, threads):
pass
def time_and(self, engine, threads):
pass
def time_chained_cmp(self, engine, threads):
pass
def time_mult(self, engine, threads):
pass
def teardown(self, en... | 7 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 6 | 4 | 6 | 6 | 30 | 7 | 23 | 13 | 16 | 0 | 20 | 13 | 13 | 2 | 0 | 1 | 7 |
6,811 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/eval.py | benchmarks.eval.Query | import numpy as np
import pandas as pd
class Query:
def setup(self):
N = 10 ** 6
halfway = N // 2 - 1
index = pd.date_range('20010101', periods=N, freq='min')
s = pd.Series(index)
self.ts = s.iloc[halfway]
self.df = pd.DataFrame({'a': np.random.randn(N), 'dates': in... |
class Query:
def setup(self):
pass
def time_query_datetime_index(self):
pass
def time_query_datetime_column(self):
pass
def time_query_with_boolean_selection(self):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 4 | 4 | 4 | 20 | 3 | 17 | 14 | 12 | 0 | 17 | 14 | 12 | 1 | 0 | 0 | 4 |
6,812 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/finalize.py | benchmarks.finalize.Finalize | import pandas as pd
class Finalize:
param_names = ['series', 'frame']
params = [pd.Series, pd.DataFrame]
def setup(self, param):
N = 1000
obj = param(dtype=float)
for i in range(N):
obj.attrs[i] = i
self.obj = obj
def time_finalize_micro(self, param):
... |
class Finalize:
def setup(self, param):
pass
def time_finalize_micro(self, param):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 2 | 11 | 9 | 8 | 0 | 11 | 9 | 8 | 2 | 0 | 1 | 3 |
6,813 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromArrays | import pandas as pd
from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
import numpy as np
class FromArrays:
goal_time = 0.2
def setup(self):
N_rows = 1000
N_cols = 1000
self.float_arrays = [np.random.randn(N_rows) for _ in range(N_col... |
class FromArrays:
def setup(self):
pass
def time_frame_from_arrays_float(self):
pass
def time_frame_from_arrays_int(self):
pass
def time_frame_from_arrays_sparse(self):
pass | 5 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 6 | 4 | 4 | 41 | 4 | 37 | 14 | 32 | 0 | 16 | 14 | 11 | 1 | 0 | 0 | 4 |
6,814 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromDicts | import numpy as np
import pandas as pd
from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromDicts:
def setup(self):
N, K = (5000, 50)
self.index = pd.Index([f'i-{i}' for i in range(N)], dtype=object)
self.columns = pd.Index([f'i-{... |
class FromDicts:
def setup(self):
pass
def time_list_of_dict(self):
pass
def time_nested_dict(self):
pass
def time_nested_dict_index(self):
pass
def time_nested_dict_columns(self):
pass
def time_nested_dict_index_columns(self):
pass
def... | 9 | 0 | 3 | 0 | 3 | 0 | 1 | 0.13 | 0 | 3 | 0 | 0 | 8 | 6 | 8 | 8 | 35 | 8 | 24 | 17 | 15 | 3 | 24 | 17 | 15 | 1 | 0 | 0 | 8 |
6,815 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromDictwithTimestamp | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
import numpy as np
class FromDictwithTimestamp:
params = [Nano(1), Hour(1)]
param_names = ['offset']
def setup(self, offset):
N = 10 ** 3
idx = date_range(Timestamp('1/1/1900'), freq=offs... |
class FromDictwithTimestamp:
def setup(self, offset):
pass
def time_dict_with_timestamp_offsets(self, offset):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 12 | 2 | 10 | 9 | 7 | 0 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
6,816 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromLists | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromLists:
goal_time = 0.2
def setup(self):
N = 1000
M = 100
self.data = [list(range(M)) for i in range(N)]
def time_frame_from_lists(self):
self.df = DataFrame(sel... |
class FromLists:
def setup(self):
pass
def time_frame_from_lists(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 10 | 2 | 8 | 8 | 5 | 0 | 8 | 8 | 5 | 1 | 0 | 0 | 2 |
6,817 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromNDArray | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
import numpy as np
class FromNDArray:
def setup(self):
N = 100000
self.data = np.random.randn(N)
def time_frame_from_ndarray(self):
self.df = DataFrame(self.data) |
class FromNDArray:
def setup(self):
pass
def time_frame_from_ndarray(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 7 | 1 | 6 | 6 | 3 | 0 | 6 | 6 | 3 | 1 | 0 | 0 | 2 |
6,818 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromRange | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromRange:
goal_time = 0.2
def setup(self):
N = 1000000
self.data = range(N)
def time_frame_from_range(self):
self.df = DataFrame(self.data) |
class FromRange:
def setup(self):
pass
def time_frame_from_range(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 9 | 2 | 7 | 7 | 4 | 0 | 7 | 7 | 4 | 1 | 0 | 0 | 2 |
6,819 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromRecords | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromRecords:
params = [None, 1000]
param_names = ['nrows']
number = 1
repeat = (3, 250, 10)
def setup(self, nrows):
N = 100000
self.gen = ((x, x * 20, x * 100) for x in rang... |
class FromRecords:
def setup(self, nrows):
pass
def time_frame_from_records_generator(self, nrows):
pass | 3 | 0 | 3 | 0 | 3 | 1 | 1 | 0.2 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 15 | 3 | 10 | 10 | 7 | 2 | 10 | 10 | 7 | 1 | 0 | 0 | 2 |
6,820 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromScalar | from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromScalar:
def setup(self):
self.nrows = 100000
def time_frame_from_scalar_ea_float64(self):
DataFrame(1.0, index=range(self.nrows), columns=list('abc'), dtype=Float64Dtype())
de... |
class FromScalar:
def setup(self):
pass
def time_frame_from_scalar_ea_float64(self):
pass
def time_frame_from_scalar_ea_float64_na(self):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 1 | 3 | 3 | 19 | 2 | 17 | 5 | 13 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
6,821 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_ctor.py | benchmarks.frame_ctor.FromSeries | import numpy as np
from pandas import NA, Categorical, DataFrame, Float64Dtype, MultiIndex, Series, Timestamp, date_range
class FromSeries:
def setup(self):
mi = MultiIndex.from_product([range(100), range(100)])
self.s = Series(np.random.randn(10000), index=mi)
def time_mi_series(self):
... |
class FromSeries:
def setup(self):
pass
def time_mi_series(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,822 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Apply | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Apply:
def setup(self):
self.df = DataFrame(np.random.randn(1000, 100))
self.s = Series(np.arange(1028.0))
self.df2 = DataFrame(dict.fromkeys(range(1028)... | null | 8 | 0 | 3 | 0 | 2 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 7 | 4 | 7 | 7 | 25 | 7 | 18 | 12 | 10 | 0 | 18 | 12 | 10 | 1 | 0 | 0 | 7 |
6,823 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.AsType | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class AsType:
params = [[('Float64', 'Float64'), ('float64[pyarrow]', 'float64[pyarrow]'), ('float64', 'Float64'), ('float64', 'float64[pyarrow]'), ('Float64', 'float64'), ('float64[py... |
class AsType:
def setup(self, from_to_dtypes, copy):
pass
def time_astype(self, from_to_dtypes, copy):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 2 | 0.15 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 32 | 2 | 26 | 8 | 23 | 4 | 12 | 8 | 9 | 3 | 0 | 1 | 4 |
6,824 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Clip | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Clip:
params = [['float64', 'Float64', 'float64[pyarrow]']]
param_names = ['dtype']
def setup(self, dtype):
data = np.random.randn(100000, 10)
df = DataF... |
class Clip:
def setup(self, dtype):
pass
def time_clip(self, dtype):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 2 | 11 | 8 | 8 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
6,825 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Count | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Count:
params = [0, 1]
param_names = ['axis']
def setup(self, axis):
self.df = DataFrame(np.random.randn(10000, 1000))
self.df.iloc[50:1000, 20:50] = np.... |
class Count:
def setup(self, axis):
pass
def time_count(self, axis):
pass
def time_count_mixed_dtypes(self, axis):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 17 | 3 | 14 | 8 | 10 | 0 | 14 | 8 | 10 | 1 | 0 | 0 | 3 |
6,826 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Describe | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Describe:
def setup(self):
self.df = DataFrame({'a': np.random.randint(0, 100, 10 ** 6), 'b': np.random.randint(0, 100, 10 ** 6), 'c': np.random.randint(0, 100, 10 ** 6)... |
class Describe:
def setup(self):
pass
def time_series_describe(self):
pass
def time_dataframe_describe(self):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 15 | 2 | 13 | 5 | 9 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
6,827 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Dropna | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Dropna:
params = (['all', 'any'], [0, 1])
param_names = ['how', 'axis']
def setup(self, how, axis):
self.df = DataFrame(np.random.randn(10000, 1000))
sel... |
class Dropna:
def setup(self, how, axis):
pass
def time_dropna(self, how, axis):
pass
def time_dropna_axis_mixed_dtypes(self, how, axis):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 17 | 3 | 14 | 8 | 10 | 0 | 14 | 8 | 10 | 1 | 0 | 0 | 3 |
6,828 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Dtypes | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Dtypes:
def setup(self):
self.df = DataFrame(np.random.randn(1000, 1000))
def time_frame_dtypes(self):
self.df.dtypes |
class Dtypes:
def setup(self):
pass
def time_frame_dtypes(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
6,829 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Duplicated | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Duplicated:
def setup(self):
n = 1 << 20
t = date_range('2015-01-01', freq='s', periods=n // 64)
xs = np.random.randn(n // 64).round(2)
self.df =... |
class Duplicated:
def setup(self):
pass
def time_frame_duplicated(self):
pass
def time_frame_duplicated_wide(self):
pass
def time_frame_duplicated_subset(self):
pass | 5 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 22 | 3 | 19 | 10 | 14 | 0 | 13 | 10 | 8 | 1 | 0 | 0 | 4 |
6,830 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Equals | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
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.... |
class Equals:
def setup(self):
pass
def time_frame_float_equal(self):
pass
def time_frame_float_unequal(self):
pass
def time_frame_nonunique_equal(self):
pass
def time_frame_nonunique_unequal(self):
pass
def time_frame_object_equal(self):
pa... | 8 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 7 | 6 | 7 | 7 | 33 | 8 | 25 | 15 | 17 | 0 | 25 | 15 | 17 | 1 | 0 | 0 | 7 |
6,831 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Fillna | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Fillna:
params = ([True, False], ['float64', 'float32', 'object', 'Int64', 'Float64', 'datetime64[ns]', 'datetime64[ns, tz]', 'timedelta64[ns]'])
param_names = ['inplace', 'd... |
class Fillna:
def setup(self, inplace, dtype):
pass
def time_fillna(self, inplace, dtype):
pass
def time_ffill(self, inplace, dtype):
pass
def time_bfill(self, inplace, dtype):
pass | 5 | 0 | 6 | 0 | 6 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 4 | 2 | 4 | 4 | 44 | 4 | 40 | 12 | 35 | 0 | 21 | 12 | 16 | 3 | 0 | 2 | 6 |
6,832 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.FindValidIndex | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class FindValidIndex:
param_names = ['dtype']
params = [['float', 'Float64', 'float64[pyarrow]']]
def setup(self, dtype):
df = DataFrame(np.random.randn(100000, 2), co... |
class FindValidIndex:
def setup(self, dtype):
pass
def time_first_valid_index(self, dtype):
pass
def time_last_valid_index(self, dtype):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 23 | 3 | 20 | 8 | 16 | 0 | 14 | 8 | 10 | 1 | 0 | 0 | 3 |
6,833 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.GetDtypeCounts | import numpy as np
import warnings
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class GetDtypeCounts:
def setup(self):
self.df = DataFrame(np.random.randn(10, 10000))
def time_frame_get_dtype_counts(self):
with warnings.catch_... |
class GetDtypeCounts:
def setup(self):
pass
def time_frame_get_dtype_counts(self):
pass
def time_info(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0.13 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 11 | 2 | 8 | 5 | 4 | 1 | 8 | 5 | 4 | 1 | 0 | 1 | 3 |
6,834 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.GetNumericData | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class GetNumericData:
def setup(self):
self.df = DataFrame(np.random.randn(10000, 25))
self.df['foo'] = 'bar'
self.df['bar'] = 'baz'
self.df = self.df.... |
class GetNumericData:
def setup(self):
pass
def time_frame_get_numeric_data(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 4 | 5 | 0 | 8 | 4 | 5 | 1 | 0 | 0 | 2 |
6,835 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Interpolate | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Interpolate:
def setup(self):
N = 10000
arr = np.random.randn(N, 100)
arr[::2] = np.nan
self.df = DataFrame(arr)
self.df2 = DataFrame({'A... |
class Interpolate:
def setup(self):
pass
def time_interpolate(self):
pass
def time_interpolate_some_good(self):
pass | 4 | 0 | 7 | 1 | 6 | 0 | 1 | 0.05 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 25 | 4 | 20 | 8 | 16 | 1 | 13 | 8 | 9 | 1 | 0 | 0 | 3 |
6,836 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Isna | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Isna:
params = ['float64', 'Float64', 'float64[pyarrow]']
param_names = ['dtype']
def setup(self, dtype):
data = np.random.randn(10000, 1000)
data[:, 600... |
class Isna:
def setup(self, dtype):
pass
def time_isna(self, dtype):
pass | 3 | 0 | 5 | 0 | 4 | 1 | 1 | 0.2 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 14 | 2 | 10 | 7 | 7 | 2 | 10 | 7 | 7 | 1 | 0 | 0 | 2 |
6,837 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Isnull | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import string
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.... |
class Isnull:
def setup(self):
pass
def time_isnull_floats_no_null(self):
pass
def time_isnull_floats_no_null(self):
pass
def time_isnull_strngs(self):
pass
def time_isnull_obj(self):
pass | 6 | 0 | 7 | 1 | 7 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 | 4 | 5 | 5 | 41 | 7 | 34 | 13 | 28 | 0 | 21 | 13 | 15 | 1 | 0 | 0 | 5 |
6,838 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Iteration | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Iteration:
timeout = 120
def setup(self):
N = 1000
self.df = DataFrame(np.random.randn(N * 10, N))
self.df2 = DataFrame(np.random.randn(N * 50, 10))
... |
class Iteration:
def setup(self):
pass
def time_items(self):
pass
def time_iteritems_indexing(self):
pass
def time_itertuples_start(self):
pass
def time_itertuples_read_first(self):
pass
def time_itertuples_start(self):
pass
def time_it... | 25 | 0 | 3 | 0 | 3 | 0 | 1 | 0.03 | 0 | 3 | 0 | 0 | 24 | 4 | 24 | 24 | 89 | 24 | 63 | 38 | 38 | 2 | 61 | 38 | 36 | 2 | 0 | 1 | 31 |
6,839 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.MaskBool | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
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 = i... |
class MaskBool:
def setup(self):
pass
def time_frame_mask_bools(self):
pass
def time_frame_mask_floats(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 13 | 2 | 11 | 8 | 7 | 0 | 11 | 8 | 7 | 1 | 0 | 0 | 3 |
6,840 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.MemoryUsage | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class MemoryUsage:
def setup(self):
self.df = DataFrame(np.random.randn(100000, 2), columns=list('AB'))
self.df2 = self.df.copy()
self.df2['A'] = self.df2['A']... |
class MemoryUsage:
def setup(self):
pass
def time_memory_usage(self):
pass
def time_memory_usage_object_dtype(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 11 | 2 | 9 | 6 | 5 | 0 | 9 | 6 | 5 | 1 | 0 | 0 | 3 |
6,841 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.NSort | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class NSort:
params = ['first', 'last', 'all']
param_names = ['keep']
def setup(self, keep):
self.df = DataFrame(np.random.randn(100000, 3), columns=list('ABC'))
... |
class NSort:
def setup(self, keep):
pass
def time_nlargest_one_column(self, keep):
pass
def time_nlargest_two_columns(self, keep):
pass
def time_nsmallest_one_column(self, keep):
pass
def time_nsmallest_two_columns(self, keep):
pass | 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 | 1 | 5 | 5 | 18 | 5 | 13 | 9 | 7 | 0 | 13 | 9 | 7 | 1 | 0 | 0 | 5 |
6,842 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Nunique | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Nunique:
def setup(self):
self.df = DataFrame(np.random.randn(10000, 1000))
def time_frame_nunique(self):
self.df.nunique() |
class Nunique:
def setup(self):
pass
def time_frame_nunique(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
6,843 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Quantile | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Quantile:
params = [0, 1]
param_names = ['axis']
def setup(self, axis):
self.df = DataFrame(np.random.randn(1000, 3), columns=list('ABC'))
def time_frame_qu... |
class Quantile:
def setup(self, axis):
pass
def time_frame_quantile(self, axis):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 2 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,844 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Rank | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Rank:
param_names = ['dtype']
params = [['int', 'uint', 'float', 'object']]
def setup(self, dtype):
self.df = DataFrame(np.random.randn(10000, 10).astype(dtype),... |
class Rank:
def setup(self, dtype):
pass
def time_rank(self, dtype):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 2 | 11 | 6 | 8 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,845 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Reindex | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Reindex:
def setup(self):
N = 10 ** 3
self.df = DataFrame(np.random.randn(N * 10, N))
self.idx = np.arange(4 * N, 7 * N)
self.idx_cols = np.rando... |
class Reindex:
def setup(self):
pass
def time_reindex_axis0(self):
pass
def time_reindex_axis1(self):
pass
def time_reindex_axis1_missing(self):
pass
def time_reindex_both_axes(self):
pass
def time_reindex_upcast(self):
pass | 7 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 6 | 4 | 6 | 6 | 32 | 5 | 27 | 12 | 20 | 0 | 17 | 12 | 10 | 1 | 0 | 0 | 6 |
6,846 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Rename | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
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... |
class Rename:
def setup(self):
pass
def time_rename_single(self):
pass
def time_rename_axis0(self):
pass
def time_rename_axis1(self):
pass
def time_rename_both_axes(self):
pass
def time_dict_rename_both_axes(self):
pass | 7 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 6 | 4 | 6 | 6 | 32 | 5 | 27 | 12 | 20 | 0 | 17 | 12 | 10 | 1 | 0 | 0 | 6 |
6,847 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Repr | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
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.f... |
class Repr:
def setup(self):
pass
def time_html_repr_trunc_mi(self):
pass
def time_html_repr_trunc_si(self):
pass
def time_repr_tall(self):
pass
def time_frame_repr_wide(self):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 4 | 5 | 5 | 22 | 4 | 18 | 14 | 12 | 0 | 18 | 14 | 12 | 1 | 0 | 0 | 5 |
6,848 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Round | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Round:
def setup(self):
self.df = DataFrame(np.random.randn(10000, 10))
self.df_t = self.df.transpose(copy=True)
def time_round(self):
self.df.round... |
class Round:
def setup(self):
pass
def time_round(self):
pass
def time_round_transposed(self):
pass
def peakmem_round(self):
pass
def peakmem_round_transposed(self):
pass | 6 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 2 | 5 | 5 | 16 | 4 | 12 | 8 | 6 | 0 | 12 | 8 | 6 | 1 | 0 | 0 | 5 |
6,849 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.SeriesNuniqueWithNan | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class SeriesNuniqueWithNan:
def setup(self):
values = 100 * [np.nan] + list(range(100))
self.ser = Series(np.tile(values, 10000), dtype=float)
def time_series_nun... |
class SeriesNuniqueWithNan:
def setup(self):
pass
def time_series_nunique_nan(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 7 | 1 | 6 | 5 | 3 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,850 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Shift | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Shift:
params = [0, 1]
param_names = ['axis']
def setup(self, axis):
self.df = DataFrame(np.random.rand(10000, 500))
def time_shift(self, axis):
sel... |
class Shift:
def setup(self, axis):
pass
def time_shift(self, axis):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0.14 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 7 | 6 | 4 | 1 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,851 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.SortMultiKey | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class SortMultiKey:
params = [True, False]
param_names = ['monotonic']
def setup(self, monotonic):
N = 10000
K = 10
df = DataFrame({'key1': Index([f'i-... |
class SortMultiKey:
def setup(self, monotonic):
pass
def time_sort_values(self, monotonic):
pass
def time_sort_index(self, monotonic):
pass | 4 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 28 | 3 | 25 | 11 | 21 | 0 | 15 | 11 | 11 | 2 | 0 | 1 | 4 |
6,852 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.SortValues | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class SortValues:
params = [True, False]
param_names = ['ascending']
def setup(self, ascending):
self.df = DataFrame(np.random.randn(1000000, 2), columns=list('AB'))
... |
class SortValues:
def setup(self, ascending):
pass
def time_frame_sort_values(self, ascending):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 2 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,853 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.ToDict | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class ToDict:
params = [['dict', 'list', 'series', 'split', 'records', 'index']]
param_names = ['orient']
def setup(self, orient):
data = np.random.randint(0, 1000, si... |
class ToDict:
def setup(self, orient):
pass
def time_to_dict_ints(self, orient):
pass
def time_to_dict_datetimelike(self, orient):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 14 | 3 | 11 | 9 | 7 | 0 | 11 | 9 | 7 | 1 | 0 | 0 | 3 |
6,854 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.ToHTML | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
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[... |
class ToHTML:
def setup(self):
pass
def time_to_html_mixed(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 1 | 0 | 0 | 2 |
6,855 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.ToNumpy | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
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))
... |
class ToNumpy:
def setup(self):
pass
def time_to_numpy_tall(self):
pass
def time_to_numpy_wide(self):
pass
def time_to_numpy_mixed_tall(self):
pass
def time_to_numpy_mixed_wide(self):
pass
def time_values_tall(self):
pass
def time_value... | 10 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 9 | 4 | 9 | 9 | 38 | 8 | 30 | 16 | 20 | 0 | 30 | 16 | 20 | 1 | 0 | 0 | 9 |
6,856 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.ToRecords | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class ToRecords:
def setup(self):
N = 100000
data = np.random.randn(N, 2)
mi = MultiIndex.from_arrays([np.arange(N), date_range('1970-01-01', periods=N, freq='... |
class ToRecords:
def setup(self):
pass
def time_to_records(self):
pass
def time_to_records_multiindex(self):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 18 | 2 | 16 | 9 | 12 | 0 | 11 | 9 | 7 | 1 | 0 | 0 | 3 |
6,857 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.ToString | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class ToString:
def setup(self):
self.df = DataFrame(np.random.randn(100, 10))
def time_to_string_floats(self):
self.df.to_string() |
class ToString:
def setup(self):
pass
def time_to_string_floats(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
6,858 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Update | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class Update:
def setup(self):
rng = np.random.default_rng()
self.df = DataFrame(rng.uniform(size=(1000000, 10)))
idx = rng.choice(range(1000000), size=1000000... |
class Update:
def setup(self):
pass
def time_to_update_big_frame_small_arg(self):
pass
def time_to_update_random_indices(self):
pass
def time_to_update_small_frame_big_arg(self):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 3 | 4 | 4 | 22 | 5 | 17 | 11 | 12 | 0 | 15 | 11 | 10 | 1 | 0 | 0 | 4 |
6,859 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.Where | from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
import numpy as np
class Where:
params = ([True, False], ['float64', 'Float64', 'float64[pyarrow]'])
param_names = ['dtype']
def setup(self, inplace, dtype):
self.df = DataFrame(np.rando... |
class Where:
def setup(self, inplace, dtype):
pass
def time_where(self, inplace, dtype):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 13 | 2 | 11 | 7 | 8 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,860 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/frame_methods.py | benchmarks.frame_methods.XS | import numpy as np
from pandas import DataFrame, Index, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range
class XS:
params = [0, 1]
param_names = ['axis']
def setup(self, axis):
self.N = 10 ** 4
self.df = DataFrame(np.random.randn(self.N, self.N))
def time_fra... |
class XS:
def setup(self, axis):
pass
def time_frame_xs(self, axis):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,861 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelDatetimeFields | from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
class ParallelDatetimeFields:
def setup(self):
N = 10 ** 6
self.dti = date_range('1900-01-01', periods=N, freq='min')
self.period = self.dti.to_period('D')
def time_datetime_field_year(self):
@run_pa... |
class ParallelDatetimeFields:
def setup(self):
pass
def time_datetime_field_year(self):
pass
@run_parallel(num_threads=2)
def run(dti):
pass
def time_datetime_field_day(self):
pass
@run_parallel(num_threads=2)
def run(dti):
... | 20 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 7 | 2 | 7 | 7 | 47 | 12 | 35 | 23 | 15 | 0 | 29 | 17 | 15 | 1 | 0 | 0 | 13 |
6,862 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelFactorize | from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
class ParallelFactorize:
number = 1
repeat = 5
params = [2, 4, 8]
param_names = ['threads']
def setup(self, threads):
strings = Index([f'i-{i}' for i in range(100000)], dtype=object)
@run_parallel(num_thr... |
class ParallelFactorize:
def setup(self, threads):
pass
@run_parallel(num_threads=threads)
def parallel():
pass
def loop():
pass
def time_parallel(self, threads):
pass
def time_loop(self, threads):
pass | 7 | 0 | 4 | 1 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 26 | 7 | 19 | 15 | 12 | 0 | 18 | 14 | 12 | 2 | 0 | 1 | 6 |
6,863 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelGroupbyMethods | import numpy as np
from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
class ParallelGroupbyMethods:
params = ([2, 4, 8], ['count', 'last', 'max', 'mean', 'min', 'prod', 'sum', 'var'])
param_names = ['threads', 'method']
def setup(self, threads, method):
N = 10 ** 6
... |
class ParallelGroupbyMethods:
def setup(self, threads, method):
pass
@run_parallel(num_threads=threads)
def parallel():
pass
def loop():
pass
def time_parallel(self, threads, method):
pass
def time_loop(self, threads, method):
... | 7 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 28 | 7 | 21 | 15 | 14 | 0 | 18 | 14 | 12 | 2 | 0 | 1 | 6 |
6,864 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelGroups | import numpy as np
from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
class ParallelGroups:
params = [2, 4, 8]
param_names = ['threads']
def setup(self, threads):
size = 2 ** 22
ngroups = 10 ** 3
data = Series(np.random.randint(0, ngroups, size=size))
... |
class ParallelGroups:
def setup(self, threads):
pass
@run_parallel(num_threads=threads)
def get_groups():
pass
def time_get_groups(self, threads):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 17 | 4 | 13 | 11 | 8 | 0 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
6,865 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelKth | import numpy as np
class ParallelKth:
number = 1
repeat = 5
def setup(self):
N = 10 ** 7
k = 5 * 10 ** 5
kwargs_list = [{'arr': np.random.randn(N)}, {'arr': np.random.randn(N)}]
@run_parallel(num_threads=2, kwargs_list=kwargs_list)
def parallel_kth_smallest(arr):
... |
class ParallelKth:
def setup(self):
pass
@run_parallel(num_threads=2, kwargs_list=kwargs_list)
def parallel_kth_smallest(arr):
pass
def time_kth_smallest(self):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0.08 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 19 | 5 | 13 | 11 | 8 | 1 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
6,866 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelReadCSV | import numpy as np
from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
from .pandas_vb_common import BaseIO
class ParallelReadCSV(BaseIO):
number = 1
repeat = 5
params = ['float', 'object', 'datetime']
param_names = ['dtype']
def setup(self, dtype):
rows = 10000
... |
class ParallelReadCSV(BaseIO):
def setup(self, dtype):
pass
@run_parallel(num_threads=2)
def parallel_read_csv():
pass
def time_read_csv(self, dtype):
pass | 5 | 0 | 9 | 1 | 8 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 4 | 33 | 5 | 28 | 15 | 23 | 0 | 20 | 13 | 16 | 4 | 1 | 1 | 6 |
6,867 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelRolling | import numpy as np
from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
class ParallelRolling:
params = ['median', 'mean', 'min', 'max', 'var', 'skew', 'kurt', 'std']
param_names = ['method']
def setup(self, method):
win = 100
arr = np.random.rand(100000)
if... |
class ParallelRolling:
def setup(self, method):
pass
@run_parallel(num_threads=2)
def parallel_rolling():
pass
@run_parallel(num_threads=2)
def parallel_rolling():
pass
def time_rolling(self, method):
... | 7 | 0 | 9 | 1 | 8 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 37 | 6 | 31 | 14 | 24 | 0 | 18 | 12 | 13 | 3 | 0 | 1 | 6 |
6,868 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/gil.py | benchmarks.gil.ParallelTake1D | from pandas import DataFrame, Index, Series, date_range, factorize, read_csv
import numpy as np
from pandas.core.algorithms import take_nd
class ParallelTake1D:
params = ['int64', 'float64']
param_names = ['dtype']
def setup(self, dtype):
N = 10 ** 6
df = DataFrame({'col': np.arange(N, dty... |
class ParallelTake1D:
def setup(self, dtype):
pass
@run_parallel(num_threads=2)
def parallel_take1d():
pass
def time_take1d(self, dtype):
pass | 5 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 17 | 4 | 13 | 11 | 8 | 0 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
6,869 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.AggEngine | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class AggEngine:
param_names = ['parallel']
params = [[True, False]]
def setup(self, parallel):
N = 10 ** 3
data = DataFrame({0: [str(i) for i in range(100)] * N, 1: ... |
class AggEngine:
def setup(self, parallel):
pass
def time_series_numba(self, parallel):
pass
def function(values, index):
pass
def time_series_cython(self, parallel):
pass
def function(values, index):
pass
def time_dataframe_... | 10 | 0 | 10 | 0 | 9 | 0 | 2 | 0 | 0 | 4 | 0 | 0 | 5 | 2 | 5 | 5 | 64 | 9 | 55 | 24 | 45 | 0 | 44 | 24 | 34 | 3 | 0 | 2 | 17 |
6,870 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.AggFunctions | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class AggFunctions:
def setup_cache(self):
N = 10 ** 5
fac1 = np.array(['A', 'B', 'C'], dtype='O')
fac2 = np.array(['one', 'two'], dtype='O')
... |
class AggFunctions:
def setup_cache(self):
pass
def time_different_str_functions(self, df):
pass
def time_different_str_functions_multicol(self, df):
pass
def time_different_str_functions_singlecol(self, df):
pass | 5 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 4 | 26 | 3 | 23 | 9 | 18 | 0 | 13 | 9 | 8 | 1 | 0 | 0 | 4 |
6,871 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Apply | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Apply:
param_names = ['factor']
params = [4, 5]
def setup(self, factor):
N = 10 ** factor
labels = np.random.randint(0, 2000 if factor == 4 e... |
class Apply:
def setup(self, factor):
pass
def time_scalar_function_multi_col(self, factor):
pass
def time_scalar_function_single_col(self, factor):
pass
@staticmethod
def df_copy_function(g):
pass
def time_copy_function_multi_col(self, factor):
pass
... | 8 | 0 | 5 | 0 | 4 | 1 | 1 | 0.21 | 0 | 0 | 0 | 0 | 5 | 1 | 6 | 6 | 40 | 6 | 28 | 15 | 20 | 6 | 20 | 14 | 13 | 2 | 0 | 0 | 7 |
6,872 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.ApplyDictReturn | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class ApplyDictReturn:
def setup(self):
self.labels = np.arange(1000).repeat(10)
self.data = Series(np.random.randn(len(self.labels)))
def time_groupb... |
class ApplyDictReturn:
def setup(self):
pass
def time_groupby_apply_dict_return(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 9 | 1 | 8 | 5 | 5 | 0 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
6,873 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.ApplyNonUniqueUnsortedIndex | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class ApplyNonUniqueUnsortedIndex:
def setup(self):
idx = np.arange(100)[::-1]
idx = Index(np.repeat(idx, 200), name='key')
self.df = DataFrame(np.... |
class ApplyNonUniqueUnsortedIndex:
def setup(self):
pass
def time_groupby_apply_non_unique_unsorted_index(self):
pass | 3 | 0 | 4 | 0 | 3 | 1 | 1 | 0.29 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 1 | 7 | 5 | 4 | 2 | 7 | 5 | 4 | 1 | 0 | 0 | 2 |
6,874 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Categories | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class Categories:
params = [True, False]
param_names = ['observed']
def setup(self, observed):
N = 10 ** 5
arr = np.random.random(N)
data =... |
class Categories:
def setup(self, observed):
pass
def time_groupby_sort(self, observed):
pass
def time_groupby_nosort(self, observed):
pass
def time_groupby_ordered_sort(self, observed):
pass
def time_groupby_ordered_nosort(self, observed):
pass
def... | 8 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 7 | 3 | 7 | 7 | 39 | 7 | 32 | 16 | 24 | 0 | 24 | 16 | 16 | 1 | 0 | 0 | 7 |
6,875 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.CountMultiDtype | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class CountMultiDtype:
def setup_cache(self):
n = 10000
offsets = np.random.randint(n, size=n).astype('timedelta64[ns]')
dates = np.datetime64('now... |
class CountMultiDtype:
def setup_cache(self):
pass
def time_multi_count(self, df):
pass | 3 | 0 | 13 | 0 | 13 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 0 | 2 | 2 | 27 | 1 | 26 | 9 | 23 | 0 | 15 | 9 | 12 | 1 | 0 | 0 | 2 |
6,876 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.CountMultiInt | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class CountMultiInt:
def setup_cache(self):
n = 10000
df = DataFrame({'key1': np.random.randint(0, 500, size=n), 'key2': np.random.randint(0, 100, size=n),... |
class CountMultiInt:
def setup_cache(self):
pass
def time_multi_int_count(self, df):
pass
def time_multi_int_nunique(self, df):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | 18 | 2 | 16 | 6 | 12 | 0 | 9 | 6 | 5 | 1 | 0 | 0 | 3 |
6,877 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Cumulative | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Cumulative:
param_names = ['dtype', 'method', 'with_nans']
params = [['float64', 'int64', 'Float64', 'Int64'], ['cummin', 'cummax', 'cumsum'], [True, False]]
... |
class Cumulative:
def setup(self, dtype, method, with_nans):
pass
def time_frame_transform(self, dtype, method, with_nans):
pass | 3 | 0 | 11 | 1 | 10 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 30 | 4 | 26 | 11 | 23 | 0 | 21 | 11 | 18 | 3 | 0 | 1 | 4 |
6,878 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.DateAttributes | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class DateAttributes:
def setup(self):
rng = date_range('1/1/2000', '12/31/2005', freq='h')
self.year, self.month, self.day = (rng.year, rng.month, rng.day... |
class DateAttributes:
def setup(self):
pass
def time_len_groupby_object(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 4 | 2 | 2 | 8 | 1 | 7 | 6 | 4 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
6,879 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Datelike | from functools import partial
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class Datelike:
params = ['period_range', 'date_range', 'date_range_tz']
param_names = ['grouper']
def setup(self, grouper):
... |
class Datelike:
def setup(self, grouper):
pass
def time_sum(self, grouper):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0.07 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 17 | 2 | 14 | 9 | 11 | 1 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
6,880 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Fillna | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Fillna:
def setup(self):
N = 100
self.df = DataFrame({'group': [1] * N + [2] * N, 'value': [np.nan, 1.0] * N}).set_index('group')
def time_df_ff... |
class Fillna:
def setup(self):
pass
def time_df_ffill(self):
pass
def time_df_bfill(self):
pass
def time_srs_ffill(self):
pass
def time_srs_bfill(self):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 1 | 5 | 5 | 18 | 4 | 14 | 8 | 8 | 0 | 12 | 8 | 6 | 1 | 0 | 0 | 5 |
6,881 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Float32 | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Float32:
def setup(self):
tmp1 = (np.random.random(10000) * 0.1).astype(np.float32)
tmp2 = (np.random.random(10000) * 10.0).astype(np.float32)
... |
class Float32:
def setup(self):
pass
def time_sum(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0.11 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 11 | 1 | 9 | 8 | 6 | 1 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
6,882 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupByCythonAgg | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class GroupByCythonAgg:
"""
Benchmarks specifically targeting our cython aggregation algorithms
(using a big enough dataframe with simple key, so a large part of th... |
class GroupByCythonAgg:
'''
Benchmarks specifically targeting our cython aggregation algorithms
(using a big enough dataframe with simple key, so a large part of the
time is actually spent in the grouped aggregation).
'''
def setup(self, dtype, method):
pass
def time_frame_agg(sel... | 3 | 1 | 4 | 0 | 4 | 0 | 1 | 0.19 | 0 | 1 | 0 | 1 | 2 | 1 | 2 | 2 | 35 | 3 | 27 | 8 | 24 | 5 | 10 | 8 | 7 | 1 | 0 | 0 | 2 |
6,883 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupByCythonAggEaDtypes | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class GroupByCythonAggEaDtypes:
"""
Benchmarks specifically targeting our cython aggregation algorithms
(using a big enough dataframe with simple key, so a large pa... |
class GroupByCythonAggEaDtypes:
'''
Benchmarks specifically targeting our cython aggregation algorithms
(using a big enough dataframe with simple key, so a large part of the
time is actually spent in the grouped aggregation).
'''
def setup(self, dtype, method):
pass
def time_frame... | 3 | 1 | 6 | 0 | 6 | 0 | 1 | 0.17 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 38 | 3 | 30 | 8 | 27 | 5 | 11 | 8 | 8 | 1 | 0 | 0 | 2 |
6,884 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupByMethods | from functools import partial
import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class GroupByMethods:
param_names = ['dtype', 'method', 'application', 'ncols']
params = [['int', 'int16', 'float', 'object', 'datetime', ... |
class GroupByMethods:
def setup(self, dtype, method, application, ncols, engine):
pass
def time_dtype_as_group(self, dtype, method, application, ncols, engine):
pass
def time_dtype_as_field(self, dtype, method, application, ncols, engine):
pass | 4 | 0 | 28 | 3 | 23 | 3 | 6 | 0.07 | 0 | 3 | 0 | 0 | 3 | 2 | 3 | 3 | 132 | 11 | 114 | 17 | 110 | 8 | 44 | 17 | 40 | 15 | 0 | 1 | 17 |
6,885 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupByNumbaAgg | class GroupByNumbaAgg(GroupByCythonAgg):
"""
Benchmarks specifically targeting our numba aggregation algorithms
(using a big enough dataframe with simple key, so a large part of the
time is actually spent in the grouped aggregation).
"""
def setup(self, dtype, method):
if method in _num... | class GroupByNumbaAgg(GroupByCythonAgg):
'''
Benchmarks specifically targeting our numba aggregation algorithms
(using a big enough dataframe with simple key, so a large part of the
time is actually spent in the grouped aggregation).
'''
def setup(self, dtype, method):
pass
def tim... | 3 | 1 | 3 | 0 | 3 | 0 | 2 | 0.71 | 1 | 2 | 0 | 0 | 2 | 0 | 2 | 4 | 14 | 2 | 7 | 3 | 4 | 5 | 7 | 3 | 4 | 2 | 1 | 1 | 3 |
6,886 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupManyLabels | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class GroupManyLabels:
params = [1, 1000]
param_names = ['ncols']
def setup(self, ncols):
N = 1000
data = np.random.randn(N, ncols)
self.la... |
class GroupManyLabels:
def setup(self, ncols):
pass
def time_sum(self, ncols):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 12 | 2 | 10 | 9 | 7 | 0 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
6,887 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.GroupStrings | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
from string import ascii_letters
from itertools import product
class GroupStrings:
def setup(self):
n = 2 * 10 ** 5
alpha = list(map(''.join, product(ascii... |
class GroupStrings:
def setup(self):
pass
def time_multi_columns(self):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 12 | 1 | 11 | 7 | 8 | 0 | 11 | 7 | 8 | 1 | 0 | 0 | 2 |
6,888 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Groups | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Groups:
param_names = ['key']
params = ['int64_small', 'int64_large', 'object_small', 'object_large']
def setup_cache(self):
size = 10 ** 6
d... |
class Groups:
def setup_cache(self):
pass
def setup_cache(self):
pass
def time_series_groups(self, data, key):
pass
def time_series_indices(self, data, key):
pass | 5 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 4 | 1 | 4 | 4 | 30 | 4 | 26 | 10 | 21 | 0 | 13 | 10 | 8 | 1 | 0 | 0 | 4 |
6,889 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Int64 | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class Int64:
def setup(self):
arr = np.random.randint(-1 << 12, 1 << 12, (1 << 17, 5))
i = np.random.choice(len(arr), len(arr) * 5)
arr = np.vstack... |
class Int64:
def setup(self):
pass
def time_overflow(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 13 | 1 | 12 | 7 | 9 | 0 | 12 | 7 | 9 | 1 | 0 | 0 | 2 |
6,890 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.MultiColumn | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class MultiColumn:
def setup_cache(self):
N = 10 ** 5
key1 = np.tile(np.arange(100, dtype=object), 1000)
key2 = key1.copy()
np.random.shuff... |
class MultiColumn:
def setup_cache(self):
pass
def time_lambda_sum(self, df):
pass
def time_cython_sum(self, df):
pass
def time_col_select_lambda_sum(self, df):
pass
def time_col_select_str_sum(self, df):
pass | 6 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 | 0 | 5 | 5 | 28 | 4 | 24 | 10 | 18 | 0 | 17 | 10 | 11 | 1 | 0 | 0 | 5 |
6,891 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.MultipleCategories | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class MultipleCategories:
def setup(self):
N = 10 ** 3
arr = np.random.random(N)
data = {'a1': Categorical(np.random.randint(10000, size=N)), 'a2':... |
class MultipleCategories:
def setup(self):
pass
def time_groupby_sort(self):
pass
def time_groupby_nosort(self):
pass
def time_groupby_ordered_sort(self):
pass
def time_groupby_ordered_nosort(self):
pass
def time_groupby_extra_cat_sort(self):
... | 9 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 8 | 3 | 8 | 8 | 43 | 7 | 36 | 15 | 27 | 0 | 24 | 15 | 15 | 1 | 0 | 0 | 8 |
6,892 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Nth | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Nth:
param_names = ['dtype']
params = ['float32', 'float64', 'datetime', 'object']
def setup(self, dtype):
N = 10 ** 5
if dtype == 'datetime'... |
class Nth:
def setup(self, dtype):
pass
def time_frame_nth_any(self, dtype):
pass
def time_groupby_nth_all(self, dtype):
pass
def time_frame_nth_any(self, dtype):
pass
def time_series_nth_any(self, dtype):
pass
def time_series_nth_all(self, dtype):
... | 8 | 0 | 4 | 0 | 3 | 0 | 1 | 0.08 | 0 | 0 | 0 | 0 | 7 | 1 | 7 | 7 | 35 | 8 | 26 | 14 | 18 | 2 | 24 | 14 | 16 | 3 | 0 | 1 | 9 |
6,893 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.RankWithTies | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class RankWithTies:
param_names = ['dtype', 'tie_method']
params = [['float64', 'float32', 'int64', 'datetime64'], ['first', 'average', 'dense', 'min', 'max']]
def... |
class RankWithTies:
def setup(self, dtype, tie_method):
pass
def time_rank_ties(self, dtype, tie_method):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 2 | 0.07 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 18 | 2 | 15 | 8 | 12 | 1 | 11 | 8 | 8 | 2 | 0 | 1 | 3 |
6,894 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Resample | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class Resample:
def setup(self):
num_timedeltas = 20000
num_groups = 3
index = MultiIndex.from_product([np.arange(num_groups), to_timedelta(np.aran... |
class Resample:
def setup(self):
pass
def time_resample(self):
pass
def time_resample_multiindex(self):
pass | 4 | 0 | 7 | 1 | 6 | 0 | 1 | 0.05 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 25 | 4 | 20 | 10 | 16 | 1 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
6,895 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Sample | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Sample:
def setup(self):
N = 10 ** 3
self.df = DataFrame({'a': np.zeros(N)})
self.groups = np.arange(0, N)
self.weights = np.ones(N)
... |
class Sample:
def setup(self):
pass
def time_sample(self):
pass
def time_sample_weights(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
6,896 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Shift | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Shift:
def setup(self):
N = 18
self.df = DataFrame({'g': ['a', 'b'] * 9, 'v': list(range(N))})
def time_defaults(self):
self.df.groupby('g').shift()
d... |
class Shift:
def setup(self):
pass
def time_defaults(self):
pass
def time_fill_value(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 1 | 3 | 3 | 10 | 2 | 8 | 6 | 4 | 0 | 8 | 6 | 4 | 1 | 0 | 0 | 3 |
6,897 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.Size | import numpy as np
from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class Size:
def setup(self):
n = 10 ** 5
offsets = np.random.randint(n, size=n).astype('timedelta64[ns]')
dates = np.datetime64('now') + offsets
... |
class Size:
def setup(self):
pass
def time_multi_size(self):
pass
def time_category_size(self):
pass | 4 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 3 | 3 | 3 | 24 | 2 | 22 | 11 | 18 | 0 | 13 | 11 | 9 | 1 | 0 | 0 | 3 |
6,898 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.String | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
import numpy as np
class String:
param_names = ['dtype', 'method']
params = [['str', 'string[python]'], ['sum', 'min', 'max', 'first', 'last', 'any', 'all']]
def setup(self, dtype, m... |
class String:
def setup(self, dtype, method):
pass
def time_str_func(self, dtype, method):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0.04 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 26 | 2 | 23 | 7 | 20 | 1 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
6,899 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/groupby.py | benchmarks.groupby.SumBools | from pandas import NA, Categorical, DataFrame, Index, MultiIndex, Series, Timestamp, date_range, period_range, to_timedelta
class SumBools:
def setup(self):
N = 500
self.df = DataFrame({'ii': range(N), 'bb': [True] * N})
def time_groupby_sum_booleans(self):
self.df.groupby('ii').sum() |
class SumBools:
def setup(self):
pass
def time_groupby_sum_booleans(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0.17 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 8 | 1 | 6 | 5 | 3 | 1 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.