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

Function test_array_from_strided

python/pyarrow/tests/test_array.py:3156–3170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3154
3155@pytest.mark.numpy
3156def test_array_from_strided():
3157 pydata = [
3158 ([b"ab", b"cd", b"ef"], (pa.binary(), pa.binary(2))),
3159 ([1, 2, 3], (pa.int8(), pa.int16(), pa.int32(), pa.int64())),
3160 ([1.0, 2.0, 3.0], (pa.float32(), pa.float64())),
3161 (["ab", "cd", "ef"], (pa.utf8(), ))
3162 ]
3163
3164 for values, dtypes in pydata:
3165 nparray = np.array(values)
3166 for patype in dtypes:
3167 for mask in (None, np.array([False, False])):
3168 arrow_array = pa.array(nparray[::2], patype,
3169 mask=mask)
3170 assert values[::2] == arrow_array.to_pylist()
3171
3172
3173def test_boolean_true_count_false_count():

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.45

Tested by

no test coverage detected