quentin lhoest created ARROW-11646: -------------------------------------- Summary: [Python] Allow to create BooleanArray from a list of 0 and 1 Key: ARROW-11646 URL: https://issues.apache.org/jira/browse/ARROW-11646 Project: Apache Arrow Issue Type: Improvement Components: Python Affects Versions: 3.0.0 Reporter: quentin lhoest
Currently one can create a BooleanArray using these ways: {code:python} pa.array([False, True, True, False]) pa.array(np.array([0, 1, 1, 0]), type=pa.bool_()) pa.array([0, 1, 1, 0]).cast(pa.bool_()) {code} But creating it this way fails: {code:python} pa.array([0, 1, 1, 0], type=pa.bool_()) {code} --------------------------------------------------------------------------- ArrowInvalid Traceback (most recent call last) <ipython-input-2-e132766d7a68> in <module> ----> 1 a = pa.array([0, 1, 1, 0], type=pa.bool_()) ~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() ~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/.virtualenvs/hf-datasets/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Could not convert 0 with type int: tried to convert to boolean {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)