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

Function MaskToBitmap

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

Returns null count

Source from the content-addressed store, hash-verified

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

Callers 2

VisitNativeMethod · 0.85
VisitMethod · 0.85

Calls 2

ClearBitFunction · 0.85
SetBitFunction · 0.85

Tested by

no test coverage detected