We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c18ae4e commit d7c0575Copy full SHA for d7c0575
asv_bench/benchmarks/categoricals.py
@@ -67,6 +67,24 @@ def time_existing_series(self):
67
pd.Categorical(self.series)
68
69
70
+class AsType:
71
+ def setup(self):
72
+ N = 10 ** 6
73
+
74
+ self.df = pd.DataFrame(
75
+ np.random.default_rng()
76
+ .choice(np.array(list("abcde")), 4 * N)
77
+ .reshape(N, 4),
78
+ columns=list("ABCD"),
79
+ )
80
81
+ for col in self.df.columns:
82
+ self.df[col] = self.df[col].astype("category")
83
84
+ def astype_unicode(self):
85
+ [self.df[col].astype("unicode") for col in self.df.columns]
86
87
88
class Concat:
89
def setup(self):
90
N = 10 ** 5
0 commit comments