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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,000 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/json.py | benchmarks.io.json.ToJSONMem | from pandas import DataFrame, Index, concat, date_range, json_normalize, read_json, timedelta_range
class ToJSONMem:
def setup_cache(self):
df = DataFrame([[1]])
df2 = DataFrame(range(8), date_range('1/1/2000', periods=8, freq='min'))
frames = {'int': df, 'float': df.astype(float), 'dateti... |
class ToJSONMem:
def setup_cache(self):
pass
def peakmem_int(self, frames):
pass
def peakmem_float(self, frames):
pass
def peakmem_time(self, frames):
pass | 5 | 0 | 5 | 0 | 4 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 4 | 0 | 4 | 4 | 22 | 4 | 18 | 14 | 13 | 0 | 18 | 14 | 13 | 2 | 0 | 1 | 7 |
7,001 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/json.py | benchmarks.io.json.ToJSONWide | from pandas import DataFrame, Index, concat, date_range, json_normalize, read_json, timedelta_range
class ToJSONWide(ToJSON):
def setup(self, orient, frame):
super().setup(orient, frame)
base_df = getattr(self, frame).copy()
df_wide = concat([base_df.iloc[:100]] * 1000, ignore_index=True, ... |
class ToJSONWide(ToJSON):
def setup(self, orient, frame):
pass
def time_to_json_wide(self, orient, frame):
pass
def peakmem_to_json_wide(self, orient, frame):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 | 2 | 3 | 8 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 7 | 6 | 1 | 2 | 0 | 3 |
7,002 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/parsers.py | benchmarks.io.parsers.DoesStringLookLikeDatetime | class DoesStringLookLikeDatetime:
params = (['2Q2005', '0.0', '10000'],)
param_names = ['value']
def setup(self, value):
self.objects = [value] * 1000000
def time_check_datetimes(self, value):
for obj in self.objects:
_does_string_look_like_datetime(obj) | class DoesStringLookLikeDatetime:
def setup(self, value):
pass
def time_check_datetimes(self, value):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 2 | 0 | 1 | 3 |
7,003 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/pickle.py | benchmarks.io.pickle.Pickle | from pandas import DataFrame, Index, date_range, read_pickle
import numpy as np
from ..pandas_vb_common import BaseIO
class Pickle(BaseIO):
def setup(self):
self.fname = '__test__.pkl'
N = 100000
C = 5
self.df = DataFrame(np.random.randn(N, C), columns=[f'float{i}' for i in range(C... |
class Pickle(BaseIO):
def setup(self):
pass
def time_read_pickle(self):
pass
def time_write_pickle(self):
pass
def peakmem_read_pickle(self):
pass
def peakmem_write_pickle(self):
pass | 6 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 5 | 2 | 5 | 7 | 24 | 4 | 20 | 10 | 14 | 0 | 16 | 10 | 10 | 1 | 1 | 0 | 5 |
7,004 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/sas.py | benchmarks.io.sas.SAS | from pandas import read_sas
class SAS:
def time_read_sas7bdat(self):
read_sas(ROOT / 'test1.sas7bdat')
def time_read_xpt(self):
read_sas(ROOT / 'paxraw_d_short.xpt')
def time_read_sas7bdat_2(self):
next(read_sas(ROOT / '0x00controlbyte.sas7bdat.bz2', chunksize=11000))
def ti... |
class SAS:
def time_read_sas7bdat(self):
pass
def time_read_xpt(self):
pass
def time_read_sas7bdat_2(self):
pass
def time_read_sas7bdat_2_chunked(self):
pass | 5 | 0 | 3 | 0 | 3 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 4 | 0 | 4 | 4 | 16 | 3 | 13 | 6 | 8 | 0 | 11 | 6 | 6 | 3 | 0 | 2 | 6 |
7,005 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/sql.py | benchmarks.io.sql.ReadSQLTable | from sqlalchemy import create_engine
import numpy as np
from pandas import DataFrame, Index, date_range, read_sql_query, read_sql_table
class ReadSQLTable:
def setup(self):
N = 10000
self.table_name = 'test'
self.con = create_engine('sqlite:///:memory:')
self.df = DataFrame({'float... |
class ReadSQLTable:
def setup(self):
pass
def time_read_sql_table_all(self):
pass
def time_read_sql_table_parse_dates(self):
pass | 4 | 0 | 10 | 0 | 10 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 3 | 3 | 3 | 32 | 2 | 30 | 8 | 26 | 0 | 15 | 8 | 11 | 1 | 0 | 0 | 3 |
7,006 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/sql.py | benchmarks.io.sql.ReadSQLTableDtypes | from sqlalchemy import create_engine
import numpy as np
from pandas import DataFrame, Index, date_range, read_sql_query, read_sql_table
class ReadSQLTableDtypes:
params = ['float', 'float_with_nan', 'string', 'bool', 'int', 'date', 'time', 'datetime']
param_names = ['dtype']
def setup(self, dtype):
... |
class ReadSQLTableDtypes:
def setup(self, dtype):
pass
def time_read_sql_table_column(self, dtype):
pass | 3 | 0 | 11 | 0 | 11 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 3 | 2 | 2 | 36 | 2 | 34 | 9 | 31 | 0 | 15 | 9 | 12 | 1 | 0 | 0 | 2 |
7,007 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/sql.py | benchmarks.io.sql.SQL | from pandas import DataFrame, Index, date_range, read_sql_query, read_sql_table
import numpy as np
import sqlite3
from sqlalchemy import create_engine
class SQL:
params = ['sqlalchemy', 'sqlite']
param_names = ['connection']
def setup(self, connection):
N = 10000
con = {'sqlalchemy': creat... |
class SQL:
def setup(self, connection):
pass
def time_to_sql_dataframe(self, connection):
pass
def time_read_sql_query(self, connection):
pass | 4 | 0 | 10 | 0 | 10 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 4 | 3 | 3 | 35 | 3 | 32 | 12 | 28 | 0 | 19 | 12 | 15 | 1 | 0 | 0 | 3 |
7,008 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/sql.py | benchmarks.io.sql.WriteSQLDtypes | from pandas import DataFrame, Index, date_range, read_sql_query, read_sql_table
from sqlalchemy import create_engine
import numpy as np
import sqlite3
class WriteSQLDtypes:
params = (['sqlalchemy', 'sqlite'], ['float', 'float_with_nan', 'string', 'bool', 'int', 'date', 'time', 'datetime'])
param_names = ['conn... |
class WriteSQLDtypes:
def setup(self, connection, dtype):
pass
def time_to_sql_dataframe_column(self, connection, dtype):
pass
def time_read_sql_query_select_column(self, connection, dtype):
pass | 4 | 0 | 10 | 0 | 10 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 4 | 3 | 3 | 47 | 3 | 44 | 12 | 40 | 0 | 19 | 12 | 15 | 1 | 0 | 0 | 3 |
7,009 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/stata.py | benchmarks.io.stata.Stata | from ..pandas_vb_common import BaseIO
import numpy as np
from pandas import DataFrame, Index, date_range, read_stata
class Stata(BaseIO):
params = ['tc', 'td', 'tm', 'tw', 'th', 'tq', 'ty']
param_names = ['convert_dates']
def setup(self, convert_dates):
self.fname = '__test__.dta'
N = self... |
class Stata(BaseIO):
def setup(self, convert_dates):
pass
def time_read_stata(self, convert_dates):
pass
def time_write_stata(self, convert_dates):
pass | 4 | 0 | 9 | 0 | 9 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 3 | 5 | 3 | 5 | 32 | 3 | 29 | 11 | 25 | 0 | 19 | 11 | 15 | 1 | 1 | 0 | 3 |
7,010 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/stata.py | benchmarks.io.stata.StataMissing | import numpy as np
class StataMissing(Stata):
def setup(self, convert_dates):
super().setup(convert_dates)
for i in range(10):
missing_data = np.random.randn(self.N)
missing_data[missing_data < 0] = np.nan
self.df[f'missing_{i}'] = missing_data
self.df.t... |
class StataMissing(Stata):
def setup(self, convert_dates):
pass | 2 | 0 | 7 | 0 | 7 | 0 | 2 | 0 | 1 | 2 | 0 | 0 | 1 | 1 | 1 | 6 | 8 | 0 | 8 | 5 | 6 | 0 | 8 | 4 | 6 | 2 | 2 | 1 | 2 |
7,011 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/io/style.py | benchmarks.io.style.Render | import numpy as np
from pandas import DataFrame, IndexSlice
class Render:
params = [[12, 24, 36], [12, 120]]
param_names = ['cols', 'rows']
def setup(self, cols, rows):
self.df = DataFrame(np.random.randn(rows, cols), columns=[f'float_{i + 1}' for i in range(cols)], index=[f'row_{i + 1}' for i in ... |
class Render:
def setup(self, cols, rows):
pass
def time_apply_render(self, cols, rows):
pass
def peakmem_apply_render(self, cols, rows):
pass
def time_classes_render(self, cols, rows):
pass
def peakmem_classes_render(self, cols, rows):
pass
def tim... | 18 | 0 | 4 | 0 | 4 | 0 | 1 | 0.03 | 0 | 2 | 0 | 0 | 16 | 2 | 16 | 16 | 85 | 17 | 66 | 27 | 48 | 2 | 57 | 26 | 39 | 2 | 0 | 0 | 18 |
7,012 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.Align | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class Align:
def setup(self):
size = 5 * 10 ** 5
rng = np.arange(0, 10 ** 13, 10 ** 7)
stamps = np.datetime64('now').view('i8') + rng
idx1 = np.sort(np.random.ch... |
class Align:
def setup(self):
pass
def time_series_align_int64_index(self):
pass
def time_series_align_left_monotonic(self):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 15 | 2 | 13 | 11 | 9 | 0 | 13 | 11 | 9 | 1 | 0 | 0 | 3 |
7,013 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.Concat | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class Concat:
params = [0, 1]
param_names = ['axis']
def setup(self, axis):
N = 1000
s = Series(N, index=Index([f'i-{i}' for i in range(N)], dtype=object))
self.... |
class Concat:
def setup(self, axis):
pass
def time_concat_series(self, axis):
pass
def time_concat_small_frames(self, axis):
pass
def time_concat_empty_right(self, axis):
pass
def time_concat_empty_left(self, axis):
pass
def time_concat_mixed_ndims(... | 7 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 6 | 5 | 6 | 6 | 30 | 6 | 24 | 17 | 17 | 0 | 22 | 17 | 15 | 1 | 0 | 0 | 6 |
7,014 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.ConcatDataFrames | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class ConcatDataFrames:
params = ([0, 1], [True, False])
param_names = ['axis', 'ignore_index']
def setup(self, axis, ignore_index):
frame_c = DataFrame(np.zeros((10000, 200), d... |
class ConcatDataFrames:
def setup(self, axis, ignore_index):
pass
def time_c_ordered(self, axis, ignore_index):
pass
def time_f_ordered(self, axis, ignore_index):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 15 | 3 | 12 | 10 | 8 | 0 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
7,015 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.ConcatIndexDtype | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class ConcatIndexDtype:
params = (['datetime64[ns]', 'int64', 'Int64', 'int64[pyarrow]', 'string[python]', 'string[pyarrow]'], ['monotonic', 'non_monotonic', 'has_na'], [0, 1], [True, False])
... |
class ConcatIndexDtype:
def setup(self, dtype, structure, axis, sort):
pass
def time_concat_series(self, dtype, structure, axis, sort):
pass | 3 | 0 | 14 | 2 | 12 | 0 | 5 | 0 | 0 | 4 | 0 | 0 | 2 | 1 | 2 | 2 | 44 | 5 | 39 | 9 | 36 | 0 | 21 | 9 | 18 | 8 | 0 | 2 | 9 |
7,016 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.I8Merge | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class I8Merge:
params = ['inner', 'outer', 'left', 'right']
param_names = ['how']
def setup(self, how):
low, high, n = (-1000, 1000, 10 ** 6)
self.left = DataFrame(np.ra... |
class I8Merge:
def setup(self, how):
pass
def time_i8merge(self, how):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 16 | 2 | 14 | 8 | 11 | 0 | 12 | 8 | 9 | 1 | 0 | 0 | 2 |
7,017 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.Join | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class Join:
params = [True, False]
param_names = ['sort']
def setup(self, sort):
level1 = Index([f'i-{i}' for i in range(10)], dtype=object).values
level2 = Index([f'i-{... |
class Join:
def setup(self, sort):
pass
def time_join_dataframe_index_multi(self, sort):
pass
def time_join_dataframe_index_single_key_bigger(self, sort):
pass
def time_join_dataframe_index_single_key_small(self, sort):
pass
def time_join_dataframe_index_shuffle... | 7 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 6 | 7 | 6 | 6 | 50 | 9 | 41 | 22 | 34 | 0 | 28 | 22 | 21 | 1 | 0 | 0 | 6 |
7,018 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.JoinEmpty | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class JoinEmpty:
def setup(self):
N = 100000
self.df = DataFrame({'A': np.arange(N)})
self.df_empty = DataFrame(columns=['B', 'C'], dtype='int64')
def time_inner_jo... |
class JoinEmpty:
def setup(self):
pass
def time_inner_join_left_empty(self):
pass
def time_inner_join_right_empty(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 11 | 2 | 9 | 7 | 5 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,019 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.JoinIndex | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class JoinIndex:
def setup(self):
N = 5000
self.left = DataFrame(np.random.randint(1, N / 50, (N, 2)), columns=['jim', 'joe'])
self.right = DataFrame(np.random.randint(1... |
class JoinIndex:
def setup(self):
pass
def time_left_outer_join_index(self):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 12 | 1 | 11 | 6 | 8 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
7,020 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.JoinMultiindexSubset | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class JoinMultiindexSubset:
def setup(self):
N = 100000
mi1 = MultiIndex.from_arrays([np.arange(N)] * 4, names=['a', 'b', 'c', 'd'])
mi2 = MultiIndex.from_arrays([np.ara... |
class JoinMultiindexSubset:
def setup(self):
pass
def time_join_multiindex_subset(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 10 | 1 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,021 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.JoinNonUnique | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class JoinNonUnique:
def setup(self):
date_index = date_range('01-Jan-2013', '23-Jan-2013', freq='min')
daily_dates = date_index.to_period('D').to_timestamp('s', 's')
se... |
class JoinNonUnique:
def setup(self):
pass
def time_join_non_unique_equal(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0.17 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 15 | 1 | 12 | 8 | 9 | 2 | 12 | 8 | 9 | 1 | 0 | 0 | 2 |
7,022 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.Merge | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class Merge:
params = [True, False]
param_names = ['sort']
def setup(self, sort):
N = 10000
indices = Index([f'i-{i}' for i in range(N)], dtype=object).values
in... |
class Merge:
def setup(self, sort):
pass
def time_merge_2intkey(self, sort):
pass
def time_merge_dataframe_integer_2key(self, sort):
pass
def time_merge_dataframe_integer_key(self, sort):
pass
def time_merge_dataframe_empty_right(self, sort):
pass
d... | 8 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 7 | 5 | 7 | 7 | 48 | 8 | 40 | 20 | 32 | 0 | 26 | 20 | 18 | 1 | 0 | 0 | 7 |
7,023 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeAsof | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import string
class MergeAsof:
params = [['backward', 'forward', 'nearest'], [None, 5]]
param_names = ['direction', 'tolerance']
def setup(self, direction, tolerance):
one_count... |
class MergeAsof:
def setup(self, direction, tolerance):
pass
def time_on_int(self, direction, tolerance):
pass
def time_on_int32(self, direction, tolerance):
pass
def time_on_uint64(self, direction, tolerance):
pass
def time_by_object(self, direction, tolerance)... | 8 | 0 | 12 | 1 | 11 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 7 | 12 | 7 | 7 | 91 | 12 | 79 | 26 | 71 | 0 | 38 | 26 | 30 | 1 | 0 | 0 | 7 |
7,024 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeCategoricals | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class MergeCategoricals:
def setup(self):
self.left_object = DataFrame({'X': np.random.choice(range(10), size=(10000,)), 'Y': np.random.choice(['one', 'two', 'three'], size=(10000,))})
... |
class MergeCategoricals:
def setup(self):
pass
def time_merge_object(self):
pass
def time_merge_cat(self):
pass
def time_merge_on_cat_col(self):
pass
def time_merge_on_cat_idx(self):
pass | 6 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 | 8 | 5 | 5 | 40 | 8 | 32 | 14 | 26 | 0 | 18 | 14 | 12 | 1 | 0 | 0 | 5 |
7,025 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeDatetime | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class MergeDatetime:
params = [[('ns', 'ns'), ('ms', 'ms'), ('ns', 'ms')], [None, 'Europe/Brussels'], [True, False]]
param_names = ['units', 'tz', 'monotonic']
def setup(self, units, tz... |
class MergeDatetime:
def setup(self, units, tz, monotonic):
pass
def time_merge(self, units, tz, monotonic):
pass | 3 | 0 | 11 | 0 | 11 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 34 | 2 | 32 | 10 | 29 | 0 | 14 | 10 | 11 | 2 | 0 | 1 | 3 |
7,026 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeEA | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class MergeEA:
params = [['Int64', 'Int32', 'Int16', 'UInt64', 'UInt32', 'UInt16', 'Float64', 'Float32'], [True, False]]
param_names = ['dtype', 'monotonic']
def setup(self, dtype, mono... |
class MergeEA:
def setup(self, dtype, monotonic):
pass
def time_merge(self, dtype, monotonic):
pass | 3 | 0 | 9 | 0 | 9 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 35 | 2 | 33 | 10 | 30 | 0 | 14 | 10 | 11 | 2 | 0 | 1 | 3 |
7,027 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeMultiIndex | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class MergeMultiIndex:
params = [[('int64', 'int64'), ('datetime64[ns]', 'int64'), ('Int64', 'Int64')], ['left', 'right', 'inner', 'outer']]
param_names = ['dtypes', 'how']
def setup(se... |
class MergeMultiIndex:
def setup(self, dtypes, how):
pass
def time_merge_sorted_multiindex(self, dtypes, how):
pass | 3 | 0 | 11 | 0 | 11 | 1 | 1 | 0.03 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 34 | 2 | 31 | 13 | 28 | 1 | 14 | 13 | 11 | 1 | 0 | 0 | 2 |
7,028 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.MergeOrdered | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
class MergeOrdered:
def setup(self):
groups = Index([f'i-{i}' for i in range(10)], dtype=object).values
self.left = DataFrame({'group': groups.repeat(5000), 'key': np.tile(np.ar... |
class MergeOrdered:
def setup(self):
pass
def time_merge_ordered(self):
pass | 3 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 16 | 1 | 15 | 6 | 12 | 0 | 7 | 6 | 4 | 1 | 0 | 0 | 2 |
7,029 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/join_merge.py | benchmarks.join_merge.UniqueMerge | from pandas import DataFrame, Index, MultiIndex, Series, array, concat, date_range, merge, merge_asof
import numpy as np
class UniqueMerge:
params = [4000000, 1000000]
param_names = ['unique_elements']
def setup(self, unique_elements):
N = 1000000
self.left = DataFrame({'a': np.random.rand... |
class UniqueMerge:
def setup(self, unique_elements):
pass
def time_unique_merge(self, unique_elements):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 15 | 2 | 13 | 9 | 10 | 0 | 11 | 9 | 8 | 1 | 0 | 0 | 2 |
7,030 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/libs.py | benchmarks.libs.CacheReadonly | class CacheReadonly:
def setup(self):
class Foo:
@cache_readonly
def prop(self):
return 5
self.obj = Foo()
def time_cache_readonly(self):
self.obj.prop | class CacheReadonly:
def setup(self):
pass
class Foo:
@cache_readonly
def prop(self):
pass
def time_cache_readonly(self):
pass | 6 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 2 | 1 | 2 | 2 | 11 | 2 | 9 | 7 | 3 | 0 | 8 | 6 | 3 | 1 | 0 | 0 | 3 |
7,031 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/libs.py | benchmarks.libs.FastZip | import numpy as np
from pandas import NA, Index, NaT
from .pandas_vb_common import lib
class FastZip:
def setup(self):
N = 10000
K = 10
key1 = Index([f'i-{i}' for i in range(N)], dtype=object).values.repeat(K)
key2 = Index([f'i-{i}' for i in range(N)], dtype=object).values.repeat(K... |
class FastZip:
def setup(self):
pass
def time_lib_fast_zip(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 1 | 12 | 10 | 9 | 0 | 12 | 10 | 9 | 1 | 0 | 0 | 2 |
7,032 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/libs.py | benchmarks.libs.InferDtype | import numpy as np
from pandas._libs.lib import infer_dtype, is_list_like, is_scalar
class InferDtype:
param_names = ['dtype']
data_dict = {'np-object': np.array([1] * 100000, dtype='O'), 'py-object': [1] * 100000, 'np-null': np.array([1] * 50000 + [np.nan] * 50000), 'py-null': [1] * 50000 + [None] * 50000, 'n... |
class InferDtype:
def time_infer_dtype_skipna(self, dtype):
pass
def time_infer_dtype_skipna(self, dtype):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 19 | 2 | 17 | 6 | 14 | 0 | 8 | 6 | 5 | 1 | 0 | 0 | 2 |
7,033 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/libs.py | benchmarks.libs.ScalarListLike | from pandas._libs.lib import infer_dtype, is_list_like, is_scalar
class ScalarListLike:
params = scalars + zero_dims + listlikes
def time_is_list_like(self, param):
is_list_like(param)
def time_is_scalar(self, param):
is_scalar(param) |
class ScalarListLike:
def time_is_list_like(self, param):
pass
def time_is_scalar(self, param):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 8 | 2 | 6 | 4 | 3 | 0 | 6 | 4 | 3 | 1 | 0 | 0 | 2 |
7,034 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Append | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Append:
params = ['datetime64[ns]', 'int64', 'string']
param_names = ['dtype']
def setup(self, dtype):
N1 = 1000
N2 = 500
left_level1 = range(N1)
right_level1 = range(N1, N1 + N... |
class Append:
def setup(self, dtype):
pass
def time_append(self, dtype):
pass | 3 | 0 | 10 | 1 | 9 | 0 | 3 | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 24 | 4 | 20 | 12 | 17 | 0 | 17 | 12 | 14 | 4 | 0 | 1 | 5 |
7,035 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.CategoricalLevel | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class CategoricalLevel:
def setup(self):
self.df = DataFrame({'a': np.arange(1000000, dtype=np.int32), 'b': np.arange(1000000, dtype=np.int64), 'c': np.arange(1000000, dtype=float)}).astype({'a': ... |
class CategoricalLevel:
def setup(self):
pass
def time_categorical_level(self):
pass | 3 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 12 | 1 | 11 | 4 | 8 | 0 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
7,036 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Difference | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Difference:
params = [('datetime', 'int', 'string', 'ea_int')]
param_names = ['dtype']
def setup(self, dtype):
N = 10 ** 4 * 2
level1 = range(1000)
level2 = date_range(start='1/1/2000',... |
class Difference:
def setup(self, dtype):
pass
def time_difference(self, dtype):
pass | 3 | 0 | 15 | 3 | 12 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 36 | 8 | 28 | 15 | 25 | 0 | 21 | 15 | 18 | 1 | 0 | 0 | 2 |
7,037 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Duplicated | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Duplicated:
def setup(self):
n, k = (200, 5000)
levels = [np.arange(n), Index([f'i-{i}' for i in range(n)], dtype=object).values, 1000 + np.arange(n)]
codes = [np.random.choi... |
class Duplicated:
def setup(self):
pass
def time_duplicated(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 1 | 12 | 7 | 9 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
7,038 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Duplicates | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Duplicates:
def setup(self):
size = 65536
arrays = [np.random.randint(0, 8192, size), np.random.randint(0, 1024, size)]
mask = np.random.rand(size) < 0.1
self.mi_unus... |
class Duplicates:
def setup(self):
pass
def time_remove_unused_levels(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 1 | 9 | 7 | 6 | 0 | 9 | 7 | 6 | 1 | 0 | 0 | 2 |
7,039 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Equals | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Equals:
def setup(self):
self.mi = MultiIndex.from_product([date_range('2000-01-01', periods=1000), RangeIndex(1000)])
self.mi_deepcopy = self.mi.copy(deep=True)
self.idx_non_object = RangeInde... |
class Equals:
def setup(self):
pass
def time_equals_deepcopy(self):
pass
def time_equals_non_object_index(self):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 16 | 2 | 14 | 7 | 10 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,040 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.GetLoc | import string
import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class GetLoc:
def setup(self):
self.mi_large = MultiIndex.from_product([np.arange(1000), np.arange(20), list(string.ascii_letters)], names=['one', 'two', 'three'])
self.mi_me... |
class GetLoc:
def setup(self):
pass
def time_large_get_loc(self):
pass
def time_large_get_loc_warm(self):
pass
def time_med_get_loc(self):
pass
def time_med_get_loc_warm(self):
pass
def time_string_get_loc(self):
pass
def time_small_get... | 8 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 7 | 3 | 7 | 7 | 33 | 6 | 27 | 14 | 19 | 0 | 20 | 14 | 12 | 2 | 0 | 1 | 10 |
7,041 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.GetLocs | import string
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
import numpy as np
class GetLocs:
def setup(self):
self.mi_large = MultiIndex.from_product([np.arange(1000), np.arange(20), list(string.ascii_letters)], names=['one', 'two', 'three'])
self.mi_m... |
class GetLocs:
def setup(self):
pass
def time_large_get_locs(self):
pass
def time_med_get_locs(self):
pass
def time_small_get_locs(self):
pass | 5 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 | 3 | 4 | 4 | 21 | 3 | 18 | 8 | 13 | 0 | 11 | 8 | 6 | 1 | 0 | 0 | 4 |
7,042 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Integer | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Integer:
def setup(self):
self.mi_int = MultiIndex.from_product([np.arange(1000), np.arange(1000)], names=['one', 'two'])
self.obj_index = np.array([(0, 10), (0, 11), (0, 12), (0, 13... |
class Integer:
def setup(self):
pass
def time_get_indexer(self):
pass
def time_get_indexer_and_backfill(self):
pass
def time_get_indexer_and_pad(self):
pass
def time_is_monotonic(self):
pass | 6 | 0 | 10 | 0 | 10 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 5 | 3 | 5 | 5 | 54 | 4 | 50 | 9 | 44 | 0 | 13 | 9 | 7 | 1 | 0 | 0 | 5 |
7,043 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Isin | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Isin:
params = [('string', 'int', 'datetime')]
param_names = ['dtype']
def setup(self, dtype):
N = 10 ** 5
level1 = range(1000)
level2 = date_range(start='1/1/2000', periods=N // 1000)
... |
class Isin:
def setup(self, dtype):
pass
def time_isin_small(self, dtype):
pass
def time_isin_large(self, dtype):
pass | 4 | 0 | 9 | 2 | 7 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 3 | 3 | 3 | 34 | 8 | 26 | 16 | 22 | 0 | 20 | 16 | 16 | 1 | 0 | 0 | 3 |
7,044 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Putmask | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Putmask:
def setup(self):
N = 10 ** 5
level1 = range(1000)
level2 = date_range(start='1/1/2000', periods=N // 1000)
self.midx = MultiIndex.from_product([level1, level... |
class Putmask:
def setup(self):
pass
def time_putmask(self):
pass
def time_putmask_all_different(self):
pass | 4 | 0 | 6 | 1 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 4 | 3 | 3 | 20 | 5 | 15 | 11 | 11 | 0 | 15 | 11 | 11 | 1 | 0 | 0 | 3 |
7,045 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.SetOperations | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class SetOperations:
params = [('monotonic', 'non_monotonic'), ('datetime', 'int', 'string', 'ea_int'), ('intersection', 'union', 'symmetric_difference'), (False, None)]
param_names = ['index_structure', 'dtype', 'method... |
class SetOperations:
def setup(self, index_structure, dtype, method, sort):
pass
def time_operation(self, index_structure, dtype, method, sort):
pass | 3 | 0 | 16 | 4 | 12 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 41 | 9 | 32 | 15 | 29 | 0 | 22 | 15 | 19 | 2 | 0 | 1 | 3 |
7,046 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.SortValues | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class SortValues:
params = ['int64', 'Int64']
param_names = ['dtype']
def setup(self, dtype):
a = array(np.tile(np.arange(100), 1000), dtype=dtype)
b = array(np.tile(np.arange(1000... |
class SortValues:
def setup(self, dtype):
pass
def time_sort_values(self, dtype):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 11 | 2 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,047 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Sortlevel | import numpy as np
from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Sortlevel:
def setup(self):
n = 1182720
low, high = (-4096, 4096)
arrs = [np.repeat(np.random.randint(low, high, n // k), k) for k in [11, 7, 5, 3, 1]]
self.mi_int = ... |
class Sortlevel:
def setup(self):
pass
def time_sortlevel_int64(self):
pass
def time_sortlevel_zero(self):
pass
def time_sortlevel_one(self):
pass | 5 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 | 2 | 4 | 4 | 23 | 4 | 19 | 12 | 14 | 0 | 16 | 12 | 11 | 1 | 0 | 0 | 4 |
7,048 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Unique | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Unique:
params = [(('Int64', NA), ('int64', 0))]
param_names = ['dtype_val']
def setup(self, dtype_val):
level = Series([1, 2, dtype_val[1], dtype_val[1]] + list(range(1000000)), dtype=dtype_val[0])
... |
class Unique:
def setup(self, dtype_val):
pass
def time_unique(self, dtype_val):
pass
def time_unique_dups(self, dtype_val):
pass | 4 | 0 | 6 | 1 | 5 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 3 | 2 | 3 | 3 | 25 | 5 | 20 | 10 | 16 | 0 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
7,049 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/multiindex_object.py | benchmarks.multiindex_object.Values | from pandas import NA, DataFrame, Index, MultiIndex, RangeIndex, Series, array, date_range
class Values:
def setup_cache(self):
level1 = range(1000)
level2 = date_range(start='1/1/2012', periods=100)
mi = MultiIndex.from_product([level1, level2])
return mi
def time_datetime_le... |
class Values:
def setup_cache(self):
pass
def time_datetime_level_values_copy(self, mi):
pass
def time_datetime_level_values_sliced(self, mi):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 12 | 2 | 10 | 7 | 6 | 0 | 10 | 7 | 6 | 1 | 0 | 0 | 3 |
7,050 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/package.py | benchmarks.package.TimeImport | import subprocess
import sys
class TimeImport:
def time_import(self):
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()
to... |
class TimeImport:
def time_import(self):
pass | 2 | 0 | 11 | 1 | 7 | 4 | 1 | 0.5 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 12 | 1 | 8 | 7 | 6 | 4 | 8 | 7 | 6 | 1 | 0 | 0 | 1 |
7,051 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/pandas_vb_common.py | benchmarks.pandas_vb_common.BaseIO | import os
class BaseIO:
"""
Base class for IO benchmarks
"""
fname = None
def remove(self, f):
"""Remove created files"""
try:
os.remove(f)
except OSError:
pass
def teardown(self, *args, **kwargs):
self.remove(self.fname) |
class BaseIO:
'''
Base class for IO benchmarks
'''
def remove(self, f):
'''Remove created files'''
pass
def teardown(self, *args, **kwargs):
pass | 3 | 2 | 5 | 0 | 4 | 2 | 2 | 0.67 | 0 | 1 | 0 | 23 | 2 | 0 | 2 | 2 | 18 | 3 | 9 | 4 | 6 | 6 | 9 | 4 | 6 | 2 | 0 | 1 | 3 |
7,052 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/period.py | benchmarks.period.Algorithms | from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range
class Algorithms:
params = ['index', 'series']
param_names = ['typ']
def setup(self, typ):
data = [Period('2011-01', freq='M'), Period('2011-02', freq='M'), Period('2011-03', freq='M'), Period('2011-04', freq='M')]... |
class Algorithms:
def setup(self, typ):
pass
def time_drop_duplicates(self, typ):
pass
def time_value_counts(self, typ):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 2 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 22 | 4 | 18 | 8 | 14 | 0 | 12 | 8 | 8 | 3 | 0 | 1 | 5 |
7,053 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/period.py | benchmarks.period.DataFramePeriodColumn | from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range
class DataFramePeriodColumn:
def setup(self):
self.rng = period_range(start='1/1/1990', freq='s', periods=20000)
self.df = DataFrame(index=range(len(self.rng)))
def time_setitem_period_column(self):
se... |
class DataFramePeriodColumn:
def setup(self):
pass
def time_setitem_period_column(self):
pass
def time_set_index(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0.11 | 0 | 1 | 0 | 0 | 3 | 2 | 3 | 3 | 12 | 2 | 9 | 6 | 5 | 1 | 9 | 6 | 5 | 1 | 0 | 0 | 3 |
7,054 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/period.py | benchmarks.period.Indexing | from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range
class Indexing:
def setup(self):
self.index = period_range(start='1985', periods=1000, freq='D')
self.series = Series(range(1000), index=self.index)
self.period = self.index[500]
def time_get_loc(self)... |
class Indexing:
def setup(self):
pass
def time_get_loc(self):
pass
def time_shallow_copy(self):
pass
def time_series_loc(self):
pass
def time_align(self):
pass
def time_intersection(self):
pass
def time_unique(self):
pass | 8 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 7 | 3 | 7 | 7 | 23 | 6 | 17 | 11 | 9 | 0 | 17 | 11 | 9 | 1 | 0 | 0 | 7 |
7,055 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/period.py | benchmarks.period.PeriodIndexConstructor | from pandas.tseries.frequencies import to_offset
from pandas import DataFrame, Period, PeriodIndex, Series, date_range, period_range
class PeriodIndexConstructor:
params = [['D'], [True, False]]
param_names = ['freq', 'is_offset']
def setup(self, freq, is_offset):
self.rng = date_range('1985', per... |
class PeriodIndexConstructor:
def setup(self, freq, is_offset):
pass
def time_from_date_range(self, freq, is_offset):
pass
def time_from_pydatetime(self, freq, is_offset):
pass
def time_from_ints(self, freq, is_offset):
pass
def time_from_ints_daily(self, freq, ... | 6 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 5 | 5 | 5 | 5 | 27 | 5 | 22 | 13 | 16 | 0 | 19 | 13 | 13 | 2 | 0 | 1 | 6 |
7,056 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/plotting.py | benchmarks.plotting.BackendLoading | import sys
import pathlib
import importlib.util
import os
import importlib.machinery
import contextlib
from unittest import mock
import tempfile
from pandas.plotting._core import _get_plot_backend
class BackendLoading:
repeat = 1
number = 1
warmup_time = 0
def setup(self):
mod = importlib.util... |
class BackendLoading:
def setup(self):
pass
def teardown(self):
pass
def time_get_plot_backend(self):
pass
def time_get_plot_backend_fallback(self):
pass | 5 | 0 | 10 | 1 | 9 | 1 | 1 | 0.08 | 0 | 4 | 0 | 0 | 4 | 1 | 4 | 4 | 49 | 7 | 39 | 13 | 34 | 3 | 22 | 12 | 17 | 1 | 0 | 1 | 4 |
7,057 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/plotting.py | benchmarks.plotting.FramePlotting | from pandas import DataFrame, DatetimeIndex, Series, date_range
import numpy as np
class FramePlotting:
params = [['line', 'bar', 'area', 'barh', 'hist', 'kde', 'pie', 'scatter', 'hexbin']]
param_names = ['kind']
def setup(self, kind):
if kind in ['bar', 'barh', 'pie']:
n = 100
... |
class FramePlotting:
def setup(self, kind):
pass
def time_frame_plot(self, kind):
pass | 3 | 0 | 8 | 1 | 8 | 0 | 3 | 0 | 0 | 1 | 0 | 0 | 2 | 3 | 2 | 2 | 23 | 3 | 20 | 9 | 17 | 0 | 16 | 9 | 13 | 4 | 0 | 1 | 5 |
7,058 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/plotting.py | benchmarks.plotting.Misc | from pandas import DataFrame, DatetimeIndex, Series, date_range
import numpy as np
class Misc:
def setup(self):
N = 500
M = 10
self.df = DataFrame(np.random.randn(N, M))
self.df['Name'] = ['A'] * N
def time_plot_andrews_curves(self):
andrews_curves(self.df, 'Name') |
class Misc:
def setup(self):
pass
def time_plot_andrews_curves(self):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 9 | 1 | 8 | 6 | 5 | 0 | 8 | 6 | 5 | 1 | 0 | 0 | 2 |
7,059 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/plotting.py | benchmarks.plotting.SeriesPlotting | import numpy as np
from pandas import DataFrame, DatetimeIndex, Series, date_range
class SeriesPlotting:
params = [['line', 'bar', 'area', 'barh', 'hist', 'kde', 'pie']]
param_names = ['kind']
def setup(self, kind):
if kind in ['bar', 'barh', 'pie']:
n = 100
elif kind in ['kde'... |
class SeriesPlotting:
def setup(self, kind):
pass
def time_series_plot(self, kind):
pass | 3 | 0 | 7 | 1 | 6 | 0 | 3 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 18 | 3 | 15 | 7 | 12 | 0 | 13 | 7 | 10 | 4 | 0 | 1 | 5 |
7,060 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/plotting.py | benchmarks.plotting.TimeseriesPlotting | import numpy as np
from pandas import DataFrame, DatetimeIndex, Series, date_range
class TimeseriesPlotting:
def setup(self):
N = 2000
M = 5
idx = date_range('1/1/1975', periods=N)
self.df = DataFrame(np.random.randn(N, M), index=idx)
idx_irregular = DatetimeIndex(np.concat... |
class TimeseriesPlotting:
def setup(self):
pass
def time_plot_regular(self):
pass
def time_plot_regular_compat(self):
pass
def time_plot_irregular(self):
pass
def time_plot_table(self):
pass | 6 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 2 | 5 | 5 | 25 | 5 | 20 | 12 | 14 | 0 | 16 | 12 | 10 | 1 | 0 | 0 | 5 |
7,061 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reindex.py | benchmarks.reindex.Align | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
class Align:
def setup(self):
n = 50000
indices = Index([f'i-{i}' for i in range(n)], dtype=object)
subsample_size = 40000
self.x = Series(np.random.randn(n), indices)
self.... |
class Align:
def setup(self):
pass
def time_align_series_irregular_string(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0.08 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 14 | 1 | 12 | 8 | 9 | 1 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,062 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reindex.py | benchmarks.reindex.DropDuplicates | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
class DropDuplicates:
params = [True, False]
param_names = ['inplace']
def setup(self, inplace):
N = 10000
K = 10
key1 = Index([f'i-{i}' for i in range(N)], dtype=object).values.rep... |
class DropDuplicates:
def setup(self, inplace):
pass
def time_frame_drop_dups(self, inplace):
pass
def time_frame_drop_dups_na(self, inplace):
pass
def time_series_drop_dups_int(self, inplace):
pass
def time_series_drop_dups_string(self, inplace):
pass
... | 8 | 0 | 5 | 0 | 4 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 7 | 6 | 7 | 7 | 43 | 9 | 34 | 20 | 26 | 0 | 30 | 20 | 22 | 1 | 0 | 0 | 7 |
7,063 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reindex.py | benchmarks.reindex.LevelAlign | from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
import numpy as np
class LevelAlign:
def setup(self):
self.index = MultiIndex(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.ti... |
class LevelAlign:
def setup(self):
pass
def time_align_level(self):
pass
def time_reindex_level(self):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 3 | 3 | 18 | 2 | 16 | 7 | 12 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,064 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reindex.py | benchmarks.reindex.Reindex | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
class Reindex:
def setup(self):
rng = date_range(start='1/1/1970', periods=10000, freq='1min')
self.df = DataFrame(np.random.rand(10000, 10), index=rng, columns=range(10))
self.df['foo'] = ... |
class Reindex:
def setup(self):
pass
def time_reindex_dates(self):
pass
def time_reindex_columns(self):
pass
def time_reindex_multiindex_with_cache(self):
pass
def time_reindex_multiindex_no_cache(self):
pass
def time_reindex_multiindex_no_cache_dat... | 7 | 0 | 6 | 0 | 5 | 1 | 1 | 0.1 | 0 | 3 | 0 | 0 | 6 | 8 | 6 | 6 | 39 | 6 | 30 | 22 | 23 | 3 | 28 | 22 | 21 | 1 | 0 | 0 | 6 |
7,065 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reindex.py | benchmarks.reindex.ReindexMethod | import numpy as np
from pandas import DataFrame, Index, MultiIndex, Series, date_range, period_range
class ReindexMethod:
params = [['pad', 'backfill'], [date_range, period_range]]
param_names = ['method', 'constructor']
def setup(self, method, constructor):
N = 100000
self.idx = construct... |
class ReindexMethod:
def setup(self, method, constructor):
pass
def time_reindex_method(self, method, constructor):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 2 | 2 | 2 | 11 | 2 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,066 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/replace.py | benchmarks.replace.Convert | import pandas as pd
import numpy as np
class Convert:
params = (['DataFrame', 'Series'], ['Timestamp', 'Timedelta'])
param_names = ['constructor', 'replace_data']
def setup(self, constructor, replace_data):
N = 10 ** 3
data = {'Series': pd.Series(np.random.randint(N, size=N)), 'DataFrame':... |
class Convert:
def setup(self, constructor, replace_data):
pass
def time_replace(self, constructor, replace_data):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 2 | 2 | 2 | 17 | 2 | 15 | 9 | 12 | 0 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
7,067 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/replace.py | benchmarks.replace.FillNa | import pandas as pd
import numpy as np
class FillNa:
params = [True, False]
param_names = ['inplace']
def setup(self, inplace):
N = 10 ** 6
rng = pd.date_range('1/1/2000', periods=N, freq='min')
data = np.random.randn(N)
data[::2] = np.nan
self.ts = pd.Series(data, ... |
class FillNa:
def setup(self, inplace):
pass
def time_fillna(self, inplace):
pass
def time_replace(self, inplace):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 16 | 3 | 13 | 10 | 9 | 0 | 13 | 10 | 9 | 1 | 0 | 0 | 3 |
7,068 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/replace.py | benchmarks.replace.ReplaceDict | import numpy as np
import pandas as pd
class ReplaceDict:
params = [True, False]
param_names = ['inplace']
def setup(self, inplace):
N = 10 ** 5
start_value = 10 ** 5
self.to_rep = dict(enumerate(np.arange(N) + start_value))
self.s = pd.Series(np.random.randint(N, size=10 *... |
class ReplaceDict:
def setup(self, inplace):
pass
def time_replace_series(self, inplace):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 2 | 2 | 2 | 12 | 2 | 10 | 9 | 7 | 0 | 10 | 9 | 7 | 1 | 0 | 0 | 2 |
7,069 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/replace.py | benchmarks.replace.ReplaceList | import numpy as np
import pandas as pd
class ReplaceList:
params = [(True, False)]
param_names = ['inplace']
def setup(self, inplace):
self.df = pd.DataFrame({'A': 0, 'B': 0}, index=range(10 ** 7))
def time_replace_list(self, inplace):
self.df.replace([np.inf, -np.inf], np.nan, inplac... |
class ReplaceList:
def setup(self, inplace):
pass
def time_replace_list(self, inplace):
pass
def time_replace_list_one_match(self, inplace):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0.22 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 15 | 4 | 9 | 7 | 5 | 2 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,070 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Crosstab | import numpy as np
import pandas as pd
class Crosstab:
def setup(self):
N = 100000
fac1 = np.array(['A', 'B', 'C'], dtype='O')
fac2 = np.array(['one', 'two'], dtype='O')
self.ind1 = np.random.randint(0, 3, size=N)
self.ind2 = np.random.randint(0, 2, size=N)
self.vec... |
class Crosstab:
def setup(self):
pass
def time_crosstab(self):
pass
def time_crosstab_values(self):
pass
def time_crosstab_normalize(self):
pass
def time_crosstab_normalize_margins(self):
pass | 6 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 5 | 4 | 5 | 5 | 21 | 4 | 17 | 13 | 11 | 0 | 17 | 13 | 11 | 1 | 0 | 0 | 5 |
7,071 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Cut | import numpy as np
import pandas as pd
class Cut:
params = [[4, 10, 1000]]
param_names = ['bins']
def setup(self, bins):
N = 10 ** 5
self.int_series = pd.Series(np.arange(N).repeat(5))
self.float_series = pd.Series(np.random.randn(N).repeat(5))
self.timedelta_series = pd.Se... |
class Cut:
def setup(self, bins):
pass
def time_cut_int(self, bins):
pass
def time_cut_float(self, bins):
pass
def time_cut_timedelta(self, bins):
pass
def time_cut_datetime(self, bins):
pass
def time_qcut_int(self, bins):
pass
def time... | 12 | 0 | 3 | 0 | 3 | 0 | 1 | 0.06 | 0 | 1 | 0 | 0 | 11 | 5 | 11 | 11 | 47 | 11 | 34 | 20 | 22 | 2 | 30 | 20 | 18 | 1 | 0 | 0 | 11 |
7,072 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Explode | import pandas as pd
import numpy as np
class Explode:
param_names = ['n_rows', 'max_list_length']
params = [[100, 1000, 10000], [3, 5, 10]]
def setup(self, n_rows, max_list_length):
data = [np.arange(np.random.randint(max_list_length)) for _ in range(n_rows)]
self.series = pd.Series(data)
... |
class Explode:
def setup(self, n_rows, max_list_length):
pass
def time_explode(self, n_rows, max_list_length):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
7,073 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.GetDummies | import numpy as np
import string
from pandas.api.types import CategoricalDtype
import pandas as pd
class GetDummies:
def setup(self):
categories = list(string.ascii_letters[:12])
s = pd.Series(np.random.choice(categories, size=1000000), dtype=CategoricalDtype(categories))
self.s = s
d... |
class GetDummies:
def setup(self):
pass
def time_get_dummies_1d(self):
pass
def time_get_dummies_1d_sparse(self):
pass | 4 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 3 | 1 | 3 | 3 | 14 | 2 | 12 | 7 | 8 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,074 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Melt | import numpy as np
import pandas as pd
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
class Melt:
params = ['float64', 'Float64']
param_names = ['dtype']
def setup(self, dtype):
self.df = DataFrame(np.random.randn(100000, 3), columns=['A', 'B', 'C'], dtype=dtype)
... |
class Melt:
def setup(self, dtype):
pass
def time_melt_dataframe(self, dtype):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 2 | 11 | 6 | 8 | 0 | 9 | 6 | 6 | 1 | 0 | 0 | 2 |
7,075 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Pivot | from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
import numpy as np
class Pivot:
def setup(self):
N = 10000
index = date_range('1/1/2000', periods=N, freq='h')
data = {'value': np.random.randn(N * 50), 'variable': np.arange(50).repeat(N), 'date': np.tile(index.value... |
class Pivot:
def setup(self):
pass
def time_reshape_pivot_time_series(self):
pass | 3 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 13 | 1 | 12 | 7 | 9 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
7,076 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.PivotTable | import numpy as np
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
class PivotTable:
def setup(self):
N = 100000
fac1 = np.array(['A', 'B', 'C'], dtype='O')
fac2 = np.array(['one', 'two'], dtype='O')
ind1 = np.random.randint(0, 3, size=N)
ind2 = np.... |
class PivotTable:
def setup(self):
pass
def time_pivot_table(self):
pass
def time_pivot_table_agg(self):
pass
def time_pivot_table_margins(self):
pass
def time_pivot_table_categorical(self):
pass
def time_pivot_table_categorical_observed(self):
... | 8 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 7 | 2 | 7 | 7 | 51 | 6 | 45 | 15 | 37 | 0 | 23 | 15 | 15 | 1 | 0 | 0 | 7 |
7,077 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.ReshapeExtensionDtype | import pandas as pd
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
class ReshapeExtensionDtype:
params = ['datetime64[ns, US/Pacific]', 'Period[s]']
param_names = ['dtype']
def setup(self, dtype):
lev = pd.Index(list('ABCDEFGHIJ'))
ri = pd.Index(range(1000))
... |
class ReshapeExtensionDtype:
def setup(self, dtype):
pass
def time_stack(self, dtype):
pass
def time_unstack_fast(self, dtype):
pass
def time_unstack_slow(self, dtype):
pass
def time_transpose(self, dtype):
pass | 6 | 0 | 5 | 1 | 4 | 1 | 1 | 0.14 | 0 | 3 | 0 | 1 | 5 | 2 | 5 | 5 | 33 | 8 | 22 | 16 | 16 | 3 | 22 | 16 | 16 | 2 | 0 | 1 | 6 |
7,078 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.ReshapeMaskedArrayDtype | import numpy as np
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
import pandas as pd
class ReshapeMaskedArrayDtype(ReshapeExtensionDtype):
params = ['Int64', 'Float64']
param_names = ['dtype']
def setup(self, dtype):
lev = pd.Index(list('ABCDEFGHIJ'))
ri = pd.Ind... |
class ReshapeMaskedArrayDtype(ReshapeExtensionDtype):
def setup(self, dtype):
pass | 2 | 0 | 13 | 3 | 9 | 1 | 1 | 0.08 | 1 | 4 | 0 | 0 | 1 | 2 | 1 | 6 | 17 | 4 | 12 | 12 | 10 | 1 | 12 | 12 | 10 | 1 | 1 | 0 | 1 |
7,079 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.SimpleReshape | import numpy as np
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
class SimpleReshape:
def setup(self):
arrays = [np.arange(100).repeat(100), np.roll(np.tile(np.arange(100), 100), 25)]
index = MultiIndex.from_arrays(arrays)
self.df = DataFrame(np.random.randn(1000... |
class SimpleReshape:
def setup(self):
pass
def time_stack(self):
pass
def time_unstack(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 2 | 3 | 3 | 12 | 2 | 10 | 8 | 6 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
7,080 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.SparseIndex | from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
import numpy as np
class SparseIndex:
def setup(self):
NUM_ROWS = 1000
self.df = DataFrame({'A': np.random.randint(50, size=NUM_ROWS), 'B': np.random.randint(50, size=NUM_ROWS), 'C': np.random.randint(-10, 10, size=NUM_ROWS),... |
class SparseIndex:
def setup(self):
pass
def time_unstack(self):
pass | 3 | 0 | 8 | 0 | 8 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 17 | 1 | 16 | 5 | 13 | 0 | 7 | 5 | 4 | 1 | 0 | 0 | 2 |
7,081 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.Unstack | import pandas as pd
import string
import numpy as np
from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
class Unstack:
params = ['int', 'category']
def setup(self, dtype):
m = 100
n = 1000
levels = np.arange(m)
index = MultiIndex.from_product([levels] * 2)... |
class Unstack:
def setup(self, dtype):
pass
def time_full_product(self, dtype):
pass
def time_without_last_row(self, dtype):
pass | 4 | 0 | 9 | 1 | 7 | 1 | 1 | 0.09 | 0 | 3 | 0 | 0 | 3 | 2 | 3 | 3 | 31 | 6 | 23 | 14 | 19 | 2 | 22 | 14 | 18 | 2 | 0 | 1 | 4 |
7,082 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/reshape.py | benchmarks.reshape.WideToLong | from pandas import DataFrame, MultiIndex, date_range, melt, wide_to_long
from itertools import product
import numpy as np
class WideToLong:
def setup(self):
nyrs = 20
nidvars = 20
N = 5000
self.letters = list('ABCD')
yrvars = [letter + str(num) for letter, num in product(se... |
class WideToLong:
def setup(self):
pass
def time_wide_to_long_big(self):
pass | 3 | 0 | 7 | 0 | 7 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 2 | 2 | 2 | 2 | 16 | 1 | 15 | 10 | 12 | 0 | 12 | 10 | 9 | 1 | 0 | 0 | 2 |
7,083 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Apply | import numpy as np
import pandas as pd
class Apply:
params = (['DataFrame', 'Series'], [3, 300], ['int', 'float'], [sum, np.sum, lambda x: np.sum(x) + 5], [True, False])
param_names = ['constructor', 'window', 'dtype', 'function', 'raw']
def setup(self, constructor, window, dtype, function, raw):
... |
class Apply:
def setup(self, constructor, window, dtype, function, raw):
pass
def time_rolling(self, constructor, window, dtype, function, raw):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 17 | 2 | 15 | 8 | 12 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,084 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.EWMMethods | import numpy as np
import pandas as pd
class EWMMethods:
params = (['DataFrame', 'Series'], [({'halflife': 10}, 'mean'), ({'halflife': 10}, 'std'), ({'halflife': 1000}, 'mean'), ({'halflife': 1000}, 'std'), ({'halflife': '1 Day', 'times': pd.date_range('1900', periods=10 ** 5, freq='23s')}, 'mean')], ['int', 'floa... |
class EWMMethods:
def setup(self, constructor, kwargs_method, dtype):
pass
def time_ewm(self, constructor, kwargs_method, dtype):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 29 | 2 | 27 | 10 | 24 | 0 | 11 | 10 | 8 | 1 | 0 | 0 | 2 |
7,085 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.ForwardWindowMethods | import numpy as np
import pandas as pd
class ForwardWindowMethods:
params = (['DataFrame', 'Series'], [10, 1000], ['int', 'float'], ['median', 'mean', 'max', 'min', 'kurt', 'sum'])
param_names = ['constructor', 'window_size', 'dtype', 'method']
def setup(self, constructor, window_size, dtype, method):
... |
class ForwardWindowMethods:
def setup(self, constructor, window_size, dtype, method):
pass
def time_rolling(self, constructor, window_size, dtype, method):
pass
def peakmem_rolling(self, constructor, window_size, dtype, method):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 3 | 3 | 20 | 3 | 17 | 10 | 13 | 0 | 12 | 10 | 8 | 1 | 0 | 0 | 3 |
7,086 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Groupby | import pandas as pd
class Groupby:
params = (['sum', 'median', 'mean', 'max', 'min', 'kurt', 'sum'], [('rolling', {'window': 2}), ('rolling', {'window': '30s'}), ('expanding', {})])
def setup(self, method, window_kwargs):
N = 1000
window, kwargs = window_kwargs
df = pd.DataFrame({'A': ... |
class Groupby:
def setup(self, method, window_kwargs):
pass
def time_method(self, method, window_kwargs):
pass | 3 | 0 | 7 | 0 | 7 | 0 | 2 | 0 | 0 | 3 | 0 | 0 | 2 | 1 | 2 | 2 | 25 | 2 | 23 | 8 | 20 | 0 | 11 | 8 | 8 | 2 | 0 | 1 | 3 |
7,087 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.GroupbyEWM | import pandas as pd
class GroupbyEWM:
params = ['var', 'std', 'cov', 'corr']
param_names = ['method']
def setup(self, method):
df = pd.DataFrame({'A': range(50), 'B': range(50)})
self.gb_ewm = df.groupby('A').ewm(com=1.0)
def time_groupby_method(self, method):
getattr(self.gb_... |
class GroupbyEWM:
def setup(self, method):
pass
def time_groupby_method(self, method):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
7,088 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.GroupbyEWMEngine | import pandas as pd
class GroupbyEWMEngine:
params = ['cython', 'numba']
param_names = ['engine']
def setup(self, engine):
df = pd.DataFrame({'A': range(50), 'B': range(50)})
self.gb_ewm = df.groupby('A').ewm(com=1.0)
def time_groupby_mean(self, engine):
self.gb_ewm.mean(engin... |
class GroupbyEWMEngine:
def setup(self, engine):
pass
def time_groupby_mean(self, engine):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
7,089 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.GroupbyLargeGroups | import pandas as pd
import numpy as np
class GroupbyLargeGroups:
def setup(self):
N = 100000
self.df = pd.DataFrame({'A': [1, 2] * (N // 2), 'B': np.random.randn(N)})
def time_rolling_multiindex_creation(self):
self.df.groupby('A').rolling(3).mean() |
class GroupbyLargeGroups:
def setup(self):
pass
def time_rolling_multiindex_creation(self):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0.67 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 12 | 2 | 6 | 5 | 3 | 4 | 6 | 5 | 3 | 1 | 0 | 0 | 2 |
7,090 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Methods | import pandas as pd
import numpy as np
class Methods:
params = (['DataFrame', 'Series'], [('rolling', {'window': 10}), ('rolling', {'window': 1000}), ('expanding', {})], ['int', 'float'], ['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt', 'sum', 'sem', 'nunique'])
param_names = ['constructor', 'w... |
class Methods:
def setup(self, constructor, window_kwargs, dtype, method):
pass
def time_method(self, constructor, window_kwargs, dtype, method):
pass
def peakmem_method(self, constructor, window_kwargs, dtype, method):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 3 | 1 | 3 | 3 | 21 | 3 | 18 | 11 | 14 | 0 | 13 | 11 | 9 | 1 | 0 | 0 | 3 |
7,091 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.NumbaEngineApply | import pandas as pd
import numpy as np
import warnings
class NumbaEngineApply:
params = (['DataFrame', 'Series'], ['int', 'float'], [('rolling', {'window': 10}), ('expanding', {})], [np.sum, lambda x: np.sum(x) + 5], [True, False], [None, 100])
param_names = ['constructor', 'dtype', 'window_kwargs', 'function'... |
class NumbaEngineApply:
def setup(self, constructor, dtype, window_kwargs, function, parallel, cols):
pass
def test_method(self, constructor, dtype, window_kwargs, function, parallel, cols):
pass | 3 | 0 | 10 | 1 | 8 | 1 | 2 | 0.06 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 38 | 3 | 33 | 11 | 30 | 2 | 15 | 11 | 12 | 2 | 0 | 1 | 3 |
7,092 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.NumbaEngineMethods | import warnings
import pandas as pd
import numpy as np
class NumbaEngineMethods:
params = (['DataFrame', 'Series'], ['int', 'float'], [('rolling', {'window': 10}), ('expanding', {})], ['sum', 'max', 'min', 'median', 'mean', 'var', 'std'], [True, False], [None, 100])
param_names = ['constructor', 'dtype', 'wind... |
class NumbaEngineMethods:
def setup(self, constructor, dtype, window_kwargs, method, parallel, cols):
pass
def test_method(self, constructor, dtype, window_kwargs, method, parallel, cols):
pass | 3 | 0 | 10 | 1 | 8 | 1 | 2 | 0.06 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 38 | 3 | 33 | 11 | 30 | 2 | 15 | 11 | 12 | 2 | 0 | 1 | 3 |
7,093 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Pairwise | import numpy as np
import pandas as pd
class Pairwise:
params = ([({'window': 10}, 'rolling'), ({'window': 1000}, 'rolling'), ({}, 'expanding')], ['corr', 'cov'], [True, False])
param_names = ['window_kwargs', 'method', 'pairwise']
def setup(self, kwargs_window, method, pairwise):
N = 10 ** 4
... |
class Pairwise:
def setup(self, kwargs_window, method, pairwise):
pass
def time_pairwise(self, kwargs_window, method, pairwise):
pass
def time_groupby(self, kwargs_window, method, pairwise):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 | 3 | 3 | 3 | 25 | 3 | 22 | 14 | 18 | 0 | 16 | 14 | 12 | 1 | 0 | 0 | 3 |
7,094 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.PeakMemFixedWindowMinMax | import numpy as np
import pandas as pd
class PeakMemFixedWindowMinMax:
params = ['min', 'max']
def setup(self, operation):
N = 10 ** 6
arr = np.random.random(N)
self.roll = pd.Series(arr).rolling(2)
def peakmem_fixed(self, operation):
for x in range(5):
getattr... |
class PeakMemFixedWindowMinMax:
def setup(self, operation):
pass
def peakmem_fixed(self, operation):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 2 | 1 | 2 | 2 | 11 | 2 | 9 | 8 | 6 | 0 | 9 | 8 | 6 | 2 | 0 | 1 | 3 |
7,095 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Quantile | import pandas as pd
import numpy as np
class Quantile:
params = (['DataFrame', 'Series'], [10, 1000], ['int', 'float'], [0, 0.5, 1], ['linear', 'nearest', 'lower', 'higher', 'midpoint'])
param_names = ['constructor', 'window', 'dtype', 'percentile']
def setup(self, constructor, window, dtype, percentile, ... |
class Quantile:
def setup(self, constructor, window, dtype, percentile, interpolation):
pass
def time_quantile(self, constructor, window, dtype, percentile, interpolation):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 17 | 2 | 15 | 8 | 12 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,096 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.Rank | import numpy as np
import pandas as pd
class Rank:
params = (['DataFrame', 'Series'], [10, 1000], ['int', 'float'], [True, False], [True, False], ['min', 'max', 'average'])
param_names = ['constructor', 'window', 'dtype', 'percentile', 'ascending', 'method']
def setup(self, constructor, window, dtype, per... |
class Rank:
def setup(self, constructor, window, dtype, percentile, ascending, method):
pass
def time_rank(self, constructor, window, dtype, percentile, ascending, method):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 2 | 2 | 25 | 2 | 23 | 8 | 20 | 0 | 9 | 8 | 6 | 1 | 0 | 0 | 2 |
7,097 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.TableMethod | import numpy as np
import pandas as pd
class TableMethod:
params = ['single', 'table']
param_names = ['method']
def setup(self, method):
self.df = pd.DataFrame(np.random.randn(10, 1000))
def time_apply(self, method):
self.df.rolling(2, method=method).apply(table_method_func, raw=True,... |
class TableMethod:
def setup(self, method):
pass
def time_apply(self, method):
pass
def time_ewm_mean(self, method):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 14 | 3 | 11 | 7 | 7 | 0 | 9 | 7 | 5 | 1 | 0 | 0 | 3 |
7,098 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/rolling.py | benchmarks.rolling.VariableWindowMethods | import numpy as np
import pandas as pd
class VariableWindowMethods(Methods):
params = (['DataFrame', 'Series'], ['50s', '1h', '1d'], ['int', 'float'], ['median', 'mean', 'max', 'min', 'std', 'count', 'skew', 'kurt', 'sum', 'sem'])
param_names = ['constructor', 'window', 'dtype', 'method']
def setup(self, ... |
class VariableWindowMethods(Methods):
def setup(self, constructor, window, dtype, method):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 4 | 14 | 1 | 13 | 8 | 11 | 0 | 8 | 8 | 6 | 1 | 1 | 0 | 1 |
7,099 | pandas-dev/pandas | pandas-dev_pandas/asv_bench/benchmarks/series_methods.py | benchmarks.series_methods.All | from pandas import NA, Index, NaT, Series, date_range
class All:
params = [[10 ** 3, 10 ** 6], ['fast', 'slow'], ['bool', 'boolean']]
param_names = ['N', 'case', 'dtype']
def setup(self, N, case, dtype):
val = case != 'fast'
self.s = Series([val] * N, dtype=dtype)
def time_all(self, N... |
class All:
def setup(self, N, case, dtype):
pass
def time_all(self, N, case, dtype):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 | 1 | 2 | 2 | 10 | 2 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.