MCPcopy
hub / github.com/pandas-dev/pandas / setup

Method setup

asv_bench/benchmarks/series_methods.py:90–110  ·  asv_bench/benchmarks/series_methods.py::Fillna.setup
(self, dtype)

Source from the content-addressed store, hash-verified

88 param_names = [class="st">"dtype"]
89
90 def setup(self, dtype):
91 N = 10**6
92 if dtype == class="st">"datetime64[ns]":
93 data = date_range(class="st">"2000-01-01", freq=class="st">"s", periods=N)
94 na_value = NaT
95 elif dtype in (class="st">"float64", class="st">"Float64"):
96 data = np.random.randn(N)
97 na_value = np.nan
98 elif dtype in (class="st">"Int64", class="st">"int64[pyarrow]"):
99 data = np.arange(N)
100 na_value = NA
101 elif dtype in (class="st">"string", class="st">"string[pyarrow]"):
102 data = np.array([str(i) * 5 for i in range(N)], dtype=object)
103 na_value = NA
104 else:
105 raise NotImplementedError
106 fill_value = data[0]
107 ser = Series(data, dtype=dtype)
108 ser[::2] = na_value
109 self.ser = ser
110 self.fill_value = fill_value
111
112 def time_fillna(self, dtype):
113 self.ser.fillna(value=self.fill_value)

Callers

nothing calls this directly

Calls 3

date_rangeFunction · 0.90
SeriesClass · 0.90
arrayMethod · 0.45

Tested by

no test coverage detected