Skip to content

Commit

Permalink
Fix asv (#42732)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored Jul 26, 2021
1 parent 353ac5c commit 0ad41e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion asv_bench/benchmarks/reshape.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def setup(self, dtype):
columns = np.arange(n)
if dtype == "int":
values = np.arange(m * m * n).reshape(m * m, n)
self.df = DataFrame(values, index, columns)
else:
# the category branch is ~20x slower than int. So we
# cut down the size a bit. Now it's only ~3x slower.
Expand All @@ -111,7 +112,10 @@ def setup(self, dtype):
values = np.take(list(string.ascii_letters), indices)
values = [pd.Categorical(v) for v in values.T]

self.df = DataFrame({i: cat for i, cat in enumerate(values)}, index, columns)
self.df = DataFrame(
{i: cat for i, cat in enumerate(values)}, index, columns
)

self.df2 = self.df.iloc[:-1]

def time_full_product(self, dtype):
Expand Down

0 comments on commit 0ad41e6

Please sign in to comment.