Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,29 @@ def setup(self):
self.a = pd.Categorical(list("aabbcd") * N)
self.b = pd.Categorical(list("bbcdjk") * N)

self.idx_a = pd.CategoricalIndex(range(N), range(N))
self.idx_b = pd.CategoricalIndex(range(N + 1), range(N + 1))
self.df_a = pd.DataFrame(range(N), columns=["a"], index=self.idx_a)
self.df_b = pd.DataFrame(range(N + 1), columns=["a"], index=self.idx_b)

def time_concat(self):
pd.concat([self.s, self.s])

def time_union(self):
union_categoricals([self.a, self.b])

def time_append_overlapping_index(self):
self.idx_a.append(self.idx_a)

def time_append_non_overlapping_index(self):
self.idx_a.append(self.idx_b)

def time_concat_overlapping_index(self):
pd.concat([self.df_a, self.df_a])

def time_concat_non_overlapping_index(self):
pd.concat([self.df_a, self.df_b])


class ValueCounts:

Expand Down