Skip to content

Commit

Permalink
VB: DataFrame multiaxis reindex. #836
Browse files Browse the repository at this point in the history
  • Loading branch information
Chang She committed May 6, 2012
1 parent edae39a commit 65a6d4e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion vb_suite/frame_methods.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from vbench.benchmark import Benchmark
from vbench.api import Benchmark
from datetime import datetime

common_setup = """from pandas_vb_common import *
Expand Down Expand Up @@ -33,3 +33,20 @@
"""

frame_fillna_inplace = Benchmark('df.fillna(0, inplace=True)', setup)


#----------------------------------------------------------------------
# reindex both axes

setup = common_setup + """
df = DataFrame(randn(10000, 100))
idx = np.asarray(df.index.copy())
np.random.shuffle(idx)
idx = idx[0:9990]
cols = np.asarray(df.columns.copy())
np.random.shuffle(cols)
cols = cols[0:99]
"""

frame_multiaxis_reindex = Benchmark('df.reindex(index=idx, columns=cols)',
setup)

0 comments on commit 65a6d4e

Please sign in to comment.