MCPcopy Create free account
hub / github.com/apache/arrow / generate_bool_list

Method generate_bool_list

python/benchmarks/common.py:147–156  ·  view source on GitHub ↗

Generate a list of Python bools with *none_prob* probability of an entry being None.

(self, n, none_prob=DEFAULT_NONE_PROB)

Source from the content-addressed store, hash-verified

145 return data
146
147 def generate_bool_list(self, n, none_prob=DEFAULT_NONE_PROB):
148 """
149 Generate a list of Python bools with *none_prob* probability of
150 an entry being None.
151 """
152 # Make sure we get Python bools, not np.bool
153 data = [bool(x >= 0.5) for x in self.rnd.uniform(0.0, 1.0, n)]
154 assert len(data) == n
155 self.sprinkle_nones(data, none_prob)
156 return data
157
158 def generate_decimal_list(self, n, none_prob=DEFAULT_NONE_PROB,
159 use_nan=False):

Callers 1

generate_dict_listMethod · 0.95

Calls 2

sprinkle_nonesMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected