Module ImportFrom alias ImportFrom alias Assign NameStore Str Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Str keyword Call NameLoad Num Num Num FunctionDef arguments args NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr NameLoad keyword Str decorator_list Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Str Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad Num Num Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad Num Num Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Str keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Call NameLoad Num Num Num Assign NameStore Str Assign NameStore Call NameLoad NameLoad NameLoad keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call NameLoad Str NameLoad keyword Call NameLoad Num Num Num Assign NameStore Call NameLoad Str NameLoad keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call NameLoad Str NameLoad keyword Call NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad Str Assign NameStore Call NameLoad Str NameLoad keyword Call NameLoad Num Num Num
N/A vbench.benchmark Benchmark datetime datetime N/A common_setup from .pandas_vb_common import *
 N/A setup N/A common_setup 
df = DataFrame(index=range(10000), data=np.random.rand(10000,30),
               columns=range(30))
 N/A statement df.reindex(columns=df.columns[1:5]) N/A frame_reindex_columns N/A Benchmark statement setup N/A setup N/A common_setup 
rng = DatetimeIndex(start='1/1/1970', periods=10000, freq=datetools.Minute())
df = DataFrame(np.random.rand(10000, 10), index=rng,
               columns=range(10))
df['foo'] = 'bar'
rng2 = Index(rng[::2])
 N/A statement df.reindex(rng2) N/A dataframe_reindex N/A Benchmark statement setup N/A setup N/A common_setup 
N = 1000
K = 20

level1 = tm.makeStringIndex(N).values.repeat(K)
level2 = np.tile(tm.makeStringIndex(K).values, N)
index = MultiIndex.from_arrays([level1, level2])

s1 = Series(np.random.randn(N * K), index=index)
s2 = s1[::2]
 N/A statement s1.reindex(s2.index) N/A reindex_multi N/A Benchmark statement setup name reindex_multiindex start_date N/A datetime 2011 9 1 pad N/A N/A source_series target_index N/A N/A N/A N/A N/A N/A N/A source_series reindex target_index method pad N/A N/A N/A N/A N/A N/A source_series reindex target_index fillMethod pad N/A backfill N/A N/A source_series target_index N/A N/A N/A N/A N/A N/A N/A source_series reindex target_index method backfill N/A N/A N/A N/A N/A N/A source_series reindex target_index fillMethod backfill N/A N/A setup N/A common_setup 
rng = date_range('1/1/2000', periods=100000, freq=datetools.Minute())

ts = Series(np.random.randn(len(rng)), index=rng)
ts2 = ts[::2]
ts3 = ts2.reindex(ts.index)
ts4 = ts3.astype('float32')

def pad(source_series, target_index):
    try:
        source_series.reindex(target_index, method='pad')
    except:
        source_series.reindex(target_index, fillMethod='pad')
def backfill(source_series, target_index):
    try:
        source_series.reindex(target_index, method='backfill')
    except:
        source_series.reindex(target_index, fillMethod='backfill')
 N/A statement pad(ts2, ts.index) N/A reindex_daterange_pad N/A Benchmark statement setup name reindex_daterange_pad N/A statement backfill(ts2, ts.index) N/A reindex_daterange_backfill N/A Benchmark statement setup name reindex_daterange_backfill N/A reindex_fillna_pad N/A Benchmark ts3.fillna(method='pad') setup name reindex_fillna_pad start_date N/A datetime 2011 3 1 N/A reindex_fillna_pad_float32 N/A Benchmark ts4.fillna(method='pad') setup name reindex_fillna_pad_float32 start_date N/A datetime 2013 1 1 N/A reindex_fillna_backfill N/A Benchmark ts3.fillna(method='backfill') setup name reindex_fillna_backfill start_date N/A datetime 2011 3 1 N/A reindex_fillna_backfill_float32 N/A Benchmark ts4.fillna(method='backfill') setup name reindex_fillna_backfill_float32 start_date N/A datetime 2013 1 1 N/A setup N/A common_setup 
index = MultiIndex(levels=[np.arange(10), np.arange(100), np.arange(100)],
                   labels=[np.arange(10).repeat(10000),
                           np.tile(np.arange(100).repeat(100), 10),
                           np.tile(np.tile(np.arange(100), 100), 10)])
random.shuffle(index.values)
df = DataFrame(np.random.randn(len(index), 4), index=index)
df_level = DataFrame(np.random.randn(100, 4), index=index.levels[1])
 N/A reindex_frame_level_align N/A Benchmark df.align(df_level, level=1, copy=False) setup name reindex_frame_level_align start_date N/A datetime 2011 12 27 N/A reindex_frame_level_reindex N/A Benchmark df_level.reindex(df.index, level=1) setup name reindex_frame_level_reindex start_date N/A datetime 2011 12 27 N/A setup N/A common_setup 
N = 10000
K = 10

key1 = tm.makeStringIndex(N).values.repeat(K)
key2 = tm.makeStringIndex(N).values.repeat(K)

df = DataFrame({'key1' : key1, 'key2' : key2,
                'value' : np.random.randn(N * K)})
col_array_list = list(df.values.T)
 N/A statement df.sort_index(by=['key1', 'key2']) N/A frame_sort_index_by_columns N/A Benchmark statement setup start_date N/A datetime 2011 11 1 N/A statement df.drop_duplicates(['key1', 'key2']) N/A frame_drop_duplicates N/A Benchmark statement setup start_date N/A datetime 2011 11 15 N/A statement df.drop_duplicates(['key1', 'key2'], inplace=True) N/A frame_drop_dup_inplace N/A Benchmark statement setup start_date N/A datetime 2012 5 16 N/A lib_fast_zip N/A Benchmark lib.fast_zip(col_array_list) setup name lib_fast_zip start_date N/A datetime 2012 1 1 N/A setup N/A setup 
df.ix[:10000, :] = np.nan
 N/A statement2 df.drop_duplicates(['key1', 'key2']) N/A frame_drop_duplicates_na N/A Benchmark statement2 setup start_date N/A datetime 2012 5 15 N/A lib_fast_zip_fillna N/A Benchmark lib.fast_zip_fillna(col_array_list) setup start_date N/A datetime 2012 5 15 N/A statement2 df.drop_duplicates(['key1', 'key2'], inplace=True) N/A frame_drop_dup_na_inplace N/A Benchmark statement2 setup start_date N/A datetime 2012 5 16 N/A setup N/A common_setup 
s = Series(np.random.randint(0, 1000, size=10000))
s2 = Series(np.tile(tm.makeStringIndex(1000).values, 10))
 N/A series_drop_duplicates_int N/A Benchmark s.drop_duplicates() setup start_date N/A datetime 2012 11 27 N/A series_drop_duplicates_string N/A Benchmark s2.drop_duplicates() setup start_date N/A datetime 2012 11 27 N/A setup N/A common_setup 
values = np.random.randn(1000, 1000)
values[::2] = np.nan
df = DataFrame(values)
 N/A frame_fillna_many_columns_pad N/A Benchmark df.fillna(method='pad') setup start_date N/A datetime 2011 3 1 N/A setup N/A common_setup 
n = 50000
indices = tm.makeStringIndex(n)

def sample(values, k):
    from random import shuffle
    sampler = np.arange(len(values))
    shuffle(sampler)
    return values.take(sampler[:k])

subsample_size = 40000

x = Series(np.random.randn(50000), indices)
y = Series(np.random.randn(subsample_size),
           index=sample(indices, subsample_size))
 N/A series_align_irregular_string N/A Benchmark x + y setup start_date N/A datetime 2010 6 1