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

Function MaskToBitmap

python/pyarrow/src/arrow/python/numpy_to_arrow.cc:158–173  ·  view source on GitHub ↗

Returns null count

Source from the content-addressed store, hash-verified

156
157// Returns null count
158int64_t MaskToBitmap(PyArrayObject* mask, int64_t length, uint8_t* bitmap) {
159 int64_t null_count = 0;
160
161 if (!PyArray_Check(mask)) return -1;
162
163 Ndarray1DIndexer<uint8_t> mask_values(mask);
164 for (int i = 0; i < length; ++i) {
165 if (mask_values[i]) {
166 ++null_count;
167 bit_util::ClearBit(bitmap, i);
168 } else {
169 bit_util::SetBit(bitmap, i);
170 }
171 }
172 return null_count;
173}
174
175} // namespace
176

Callers 2

VisitNativeMethod · 0.85
VisitMethod · 0.85

Calls 2

ClearBitFunction · 0.85
SetBitFunction · 0.85

Tested by

no test coverage detected