Generate a list of Python bools with *none_prob* probability of an entry being None.
(self, n, none_prob=DEFAULT_NONE_PROB)
| 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): |
no test coverage detected